汇编语言程序设计 (从键盘输入两个一位十进制数,计算这两个数之和,并将结果在屏幕上显示)

2024-12-04 05:51:03
推荐回答(1个)
回答1:

code segment
assume cs:code
start:
mov cx,2
mov bl,0
next:
mov ah,1
int 21h
sub al,30h
jc next
cmp al,9h
ja next
add al,bl
daa
mov bl,al
mov dl,13
mov ah,2
int 21h
mov dl,10
int 21h
loop next

mov cl,4
mov dh,2
next1:
rol bl,cl
mov dl,bl
and dl,0fh
add dl,30h
mov ah,2
int 21h
dec dh
jnz next1
mov ah,1
int 21h
mov ah,4ch
int 21h
code ends
end start