汇编:将AX寄存器中16位二进制数分成四组,每组四位,然后把这四组数分别放在AL、BL、CL、和DL中。

2025-02-27 01:58:15
推荐回答(1个)
回答1:

;1.把ax寄存器内容分4组每组4位,然后把这4组数分别放在AL,BL,CL,DL中
assume cs:code
code segment
start:
mov ax,1234h
mov bx,ax
mov cx,ax
mov dx,ax
and al,0fh ;al中是4
mov cl,4
shr bl,cl ;bl中是3
and ch,0fh ;ch中是2,先存在这,最后再给cl
mov cl,4
shr dh,cl
mov dl,dh ;dl中是1
mov cl,ch
mov ax,4c00h
int 21h
code ends
end start
;----------------------------------