汇编语言的输入输出问题
我用这段代码,但是在结果输不出来,请高手指教!
stack segment汇编语言
;
stack ends
dataq segment
data DW 70 DUP(1),2,3,4,5,6,7,8,9,11,12,20 DUP(7)
dataq ends
program segment
main proc far
assume cs:program,ss:stack,ds:dataq
start:
push ds
sub ax,ax
push ax
begin: lea bx,data
push bx
mov cx,100
rotate2: mov ax,[bx]
add bx,2
test ax,01h
loopnz rotate2
jnz stop
jcxz stop2
rotate3: mov dx,[bx]
add bx,2
test dx,01h
loopnz rotate3
jnz stop
jcxz stop2
cmp ax,dx
jb rotate3
mov ax,dx
jmp rotate3
mov ch,2
mov cl,4
stop2: rol ax,cl
mov ah,2
int 21h
dec ch
jnz stop2
stop: jmp begin
stop1: ret
main endp
program ends
end start
d1:
and al,0fh
cmp al,10
jb d2
add al,7
d2:
add al,48
mov dl,al
mov ah,2 ;显示dl
int 21h
mov al,dh
dec ch
jnz d1
pop dx ;恢复现场
pop cx
pop ax
ret