Eg. : ; AL = 0110 1100
NOT AL ; AL = 1001 0011
; CX = 10101111 0010 0010
NOT CX ; CX = 0101 0000 11011001
AND: This instruction logically ANDs each bit of the source byte or word with the corresponding bit in the destination and stores result in the destination.
Eg. : ; AL = 1001 0011 = 93H
; BL = 0111 0101 = 75H
AND BL, AL ; AND Byte in AL with byte in BL
; BL = 0001 0001 = 11H
OR : This instruction logically ORs each bit of the source byte or word with the corresponding bit in the destination and stores result in the destination.
Eg. : ; AL =1001 0011 = 93H
; BL =0111 0101 = 75H
OR BL, AL ; OR byte in AL with byte in BL
; BL =1111 0111 = F7H
XOR : This instruction logically XORs each bit of the source byte or word with the corresponding bit in the destination and stores result in the destination.
TEST: This instruction logically ANDs each bit of the source byte or word with the corresponding bit in the destination and updates the flags but not stores results in anywhere.
Eg. : ; AL = 1001 0011 = 93H
; BL = 0111 0101 = 75H
AND BL, AL ; AND Byte in AL with byte in BL
; Result = 0001 0001 = 11H (not stored)
; Z = 0, P = 1 (flag affected))
AND BX, AX ; AND word in AX with word in BX
; updates the flag and result is not stored.
No comments:
Post a Comment