汇编语言:将主程序中BX寄存器内的二进制数用十六进制数的形式在屏幕上显示出来。

上机代码:

code segment  

    assume cs:code  

start:  

    mov bx,1234H  

    sub ax,ax  

    mov ch,4  

rotate:  

    mov cl,4  

    rol bx,cl  

    mov al,bl  

    and al,0fH  

    add al,30H  

    cmp al,3aH  

    jl  print  

    add al,7H  

print:  

    mov dl,al  

    mov ah,2  

    int 21H  

    dec ch  

    jnz rotate  

    mov dl,'H'  

    mov ah,2  

    int 21h  

    mov ah,4ch  

    int 21h  

code ends  

    end start  

猜你喜欢

转载自blog.csdn.net/Iris54Iris/article/details/81149947