求高手帮忙做一道汇编题。。

2024-11-24 08:11:04
推荐回答(1个)
回答1:

data segment
table db 9h,8h,7h,6h,5h,4h,3h,2h,1h,0h
msgi db 0dh,0ah,'please input the number(0-9):$'
msgo db 0dh,0ah,'Position is =$'
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
next:
lea dx,msgi
mov ah,9
int 21h
mov ah,1
int 21h
sub al,30h
lea bx,table
xlat
mov bl,al
add bl,30h
lea dx,msgo
mov ah,9
int 21h
mov dl,bl
mov ah,2
int 21h
jmp next
mov ax,4c00h
int 21h
code ends
end start