
汇编程序问题 我用的masmplus请大神看看那里有错
程序如下in16macroleadx,prcalloutputleadx,input1calloutputcallinputleasi,resultmov[si],bxl...
程序如下in 16 macro
lea dx,pr
call output
lea dx,input1
call output
call input
lea si,result
mov [si],bx
lea dx,pr
call output
lea dx,input2
call output
call input
endm
data segment
buf db'',0dh,0ah
db'*--1:add--2:sub--3:mul--4:dtv--0:quit--*',0dh,0ah
input1 db,'please inout the first number:','$'
input2 db,'please inout the second number:','$'
result DW?,?
wro db 'input the number is wrong,please input again:',0dh,0ah,'$'
pr db 0dh,0ah,'$'
pr1 db'A+B=$'
pr2 db'A-B=$'
pr3 db'A*B=$'
pr4 db'A/B=$'
pr5 db'....$'
pr6 db'are you sur exit?(y/n)$'
data ends
code segment
main proc far
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
lea dx,buf
call output
sub ax,ax
call choose
jmp start
ret
main endp
input proc near
mov bx,0
newchar
mov ah,1
int 21h
cmp al,0dh
je exit
cmp al,'A'
jae h0
cmp al,'0'
jae h1
h0:
sub al,37h
jmp addto
h1:
sub al,30h
jmp addto
addto:
mov cl,4
shl bx,cl
mov ah,0
add bx,ax
jmp newchar
exit ret
input endp
output proc near
mov ah,09h
int 21h
ret
output endp
choose proc near 因字数限制程序不能完全打出
提示错误如下
.asm(1) : error A2008: syntax error : macro
.asm(2) : error A2034: must be in segment block
.asm(3) : error A2034: must be in segment block
.asm(4) : error A2034: must be in segment block
.asm(5) : error A2034: must be in segment block
.asm(6) : error A2034: must be in segment block
.asm(7) : error A2034: must be in segment block
.asm(8) : error A2034: must be in segment block
.asm(9) : error A2034: must be in segment block
.asm(10) : error A2034: must be in segment block
.asm(11) : error A2034: must be in segment block
.asm(12) : error A2034: must be in segment block
.asm(13) : error A2034: must be in segment block
.asm(14) : fatal error A1008: unmatched macro nesting 展开
lea dx,pr
call output
lea dx,input1
call output
call input
lea si,result
mov [si],bx
lea dx,pr
call output
lea dx,input2
call output
call input
endm
data segment
buf db'',0dh,0ah
db'*--1:add--2:sub--3:mul--4:dtv--0:quit--*',0dh,0ah
input1 db,'please inout the first number:','$'
input2 db,'please inout the second number:','$'
result DW?,?
wro db 'input the number is wrong,please input again:',0dh,0ah,'$'
pr db 0dh,0ah,'$'
pr1 db'A+B=$'
pr2 db'A-B=$'
pr3 db'A*B=$'
pr4 db'A/B=$'
pr5 db'....$'
pr6 db'are you sur exit?(y/n)$'
data ends
code segment
main proc far
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
lea dx,buf
call output
sub ax,ax
call choose
jmp start
ret
main endp
input proc near
mov bx,0
newchar
mov ah,1
int 21h
cmp al,0dh
je exit
cmp al,'A'
jae h0
cmp al,'0'
jae h1
h0:
sub al,37h
jmp addto
h1:
sub al,30h
jmp addto
addto:
mov cl,4
shl bx,cl
mov ah,0
add bx,ax
jmp newchar
exit ret
input endp
output proc near
mov ah,09h
int 21h
ret
output endp
choose proc near 因字数限制程序不能完全打出
提示错误如下
.asm(1) : error A2008: syntax error : macro
.asm(2) : error A2034: must be in segment block
.asm(3) : error A2034: must be in segment block
.asm(4) : error A2034: must be in segment block
.asm(5) : error A2034: must be in segment block
.asm(6) : error A2034: must be in segment block
.asm(7) : error A2034: must be in segment block
.asm(8) : error A2034: must be in segment block
.asm(9) : error A2034: must be in segment block
.asm(10) : error A2034: must be in segment block
.asm(11) : error A2034: must be in segment block
.asm(12) : error A2034: must be in segment block
.asm(13) : error A2034: must be in segment block
.asm(14) : fatal error A1008: unmatched macro nesting 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询