You are on page 1of 2

2023-11-25 Microprocessors and Assemply language ‫تسنيم سامر غزال‬

Assignment(2)
202010412
_____________________________________________________________________________________________________________

CX 6B01H
AX = 5A02H
AX 5A02H
CX = 10FFH C 0
A 1
ADD CX, AX CX = CX + AX S 0
Z 0
5A02H + 10FFH = 6B01H O 0

SUB AX, [DI + 8]

ADD AH, [DI]

AND DH, 0A5H

MOV AH, AL

AND AH, 3FH

Explanation: to clear the two leftmost bits of AL, the content of AL


must be ANDed with this binary number 0011 1111 (the two
leftmost bits must be 0), which is equal 3FH in hexadecimal
representation.
2023-11-25 Microprocessors and Assemply language ‫تسنيم سامر غزال‬
Assignment(2)
202010412
_____________________________________________________________________________________________________________

OR BX, 0003H

Explanation: to set the two rightmost bits of BX, the content of


BX must be ANDed with this binary number 0000 0000 0000 0011
(the two rightmost bits must be 11),which is 0003H in
hexadecimal representation.

XOR BX, 1220H

Explanation: to invert bits (5, 9 & 12) of BX, the content of BX


must be XORed with this binary number 0001 0010 0010 0000
which is 1220H in hexadecimal representation.

You might also like