汇编的问题,快来吧!

来源:百度知道 编辑:UC知道 时间:2024/05/06 20:55:21
编写程序,从键盘上输入两个非组合的BCD码数据,求和,差,积,商和余数,并将结果在屏幕上显示出来。8086/8088,汇编语言,要代码哦!如果有实验报告就更好了,追加分!

data segment
msg1 db 0dh,0ah,'input the first number :$'
msg2 db 0dh,0ah,'input the other number :$'
msg3 db 0dh,0ah,'add two number :$'
msg4 db 0dh,0ah,'sub two number :$'
msg5 db 0dh,0ah,'mul two number :$'
msg6 db 0dh,0ah,'div two number :$'
msg7 db ' mod $'
first dw 0
second dw 0
data ends

code segment
main proc far
assume cs:code,ds:data

ctrl proc near
mov dl,0dh
mov ah,2h
int 21h
mov dl,0ah
mov ah,2h
int 21h
ret
ctrl endp

display proc near
mov bx,1010h
push bx
xor dx,dx
l1:
mov cx,10
div cx
add dl,30h
push dx
xor dx,dx
cmp ax,0
je print
jmp l1
print:
pop dx
cmp dx,1010h
je exit
mov ah,2h
int 21h
jmp print
exit:ret
display endp

start:
mov ax,data
mov ds,ax