20用16进制形式表示出来要写出汇编程序

来源:百度知道 编辑:UC知道 时间:2024/06/05 13:31:47

code segment
assume cs:code
main proc near
start:
mov bx,20
call transform
mov ah,4ch
int 21h
ret
main endp

transform proc near;转换16进制子程序
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,02h
int 21h
dec ch
jnz rotate
ret
transform endp

code ends
end start