汇编问题5

来源:百度知道 编辑:UC知道 时间:2024/06/05 19:24:13
计算无符号数0BF4H乘1000H,并显示结果。
计算带符号数B4H乘11H。并显示结果。
请写出程序指令。谢谢!

1.计算无符号数0BF4H乘1000H,并显示结果
code segment
assume cs:code
start:
mov ax,0bf4h
mov bx,1000h
mul bx
mov bx,dx
call disp
mov bx,ax
call disp
mov ah,1
int 21h
mov ax,4c00h
int 21h
disp proc near
push ax
mov ch,4
rotate:
mov cl,4
rol bx,cl
mov al,bl
and al,0fh
add al,30h
cmp al,3ah
jl printit
add al,7h
printit:
mov dl,al
mov ah,2
int 21h
dec ch
jnz rotate
pop ax
ret
disp endp
code ends
end start
结果为00BF4000
2.计算带符号数B4H乘11H。并显示结果
code segment
assume cs:code
start:
mov al,0b4h
mov bl,11h
imul bl
mov bx,ax
call disp
mov ah,1
int 21h
mov ax,4c00h
int 21h
disp proc near
push ax
mov ch,4
rotate:
mov cl,4
rol bx,cl
mov al,bl
and al,0fh
add al,30h
cmp al,3ah
jl printit
add al,7h
prin