我是汇编语言的新手,我在Division中遇到了一个问题。当我输入4位数字输入时,然后在显示/输出程序中以反向顺序显示输入值。
例如:
如果我输入" 1234"然后程序输出是" 4321"但我想" 1234"输出
请告诉我是否有人知道这一点。并查看代码
.model small
.stack 100h
.data
arr dw 0,0
ten db 10
.code
main proc
mov ax,@data
mov ds,ax
mov ah,1
int 21h
sub al,48
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
mov ax,arr
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
mov ax,arr
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
;Strat Division from Here
mov ax,arr
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov ah,0
mov al,cl
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov ah,0
mov al,cl
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov dl,cl
add dl,48
int 21h
mov ah,4ch
int 21h
main endp
end main