Statement | Destination Content Status Flags
| Before | After OF DF IF SF ZF AF PF CF
MOV AX,NUM1 |
AND AX,0FFDFH |
OR AL,20H |
XOR NUM1,0FF00H |
NOT NUM2 |
XOR AX,AX |
MOV AX,NUM1 |
AND AX,0008H |
XOR AX,0080H |
Attention! The values of the flags depend on the values of NUM1 and NUM2.
;Flags
data segment
NUM1 DW 0
NUM2 DW 0FH
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; Before | After
; OF DF IF SF ZF AF PF CF OF DF IF SF ZF AF PF CF
;----------------------------------------------------------------------------------
MOV AX,NUM1 ; 0 0 1 0 0 0 0 0 | 0 0 1 0 0 0 0 0
;----------------------------------------------------------------------------------
AND AX,0FFDFH ; 0 0 1 0 0 0 0 0 | 0 0 1 0 1 0 1 0
;----------------------------------------------------------------------------------
OR AL,20H ; 0 0 1 0 1 0 1 0 | 0 0 1 0 0 0 0 0
;----------------------------------------------------------------------------------
XOR NUM1,0FF00H; 0 0 1 0 0 0 0 0 | 0 0 1 1 0 0 1 0
;----------------------------------------------------------------------------------
NOT NUM2 ; 0 0 1 1 0 0 1 0 | 0 0 1 1 0 0 1 0
;----------------------------------------------------------------------------------
XOR AX,AX ; 0 0 1 1 0 0 1 0 | 0 0 1 0 1 0 1 0
;----------------------------------------------------------------------------------
MOV AX,NUM1 ; 0 0 1 0 1 0 1 0 | 0 0 1 0 1 0 1 0
;----------------------------------------------------------------------------------
AND AX,0008H ; 0 0 1 0 1 0 1 0 | 0 0 1 0 1 0 1 0
;----------------------------------------------------------------------------------
XOR AX,0080H ; 0 0 1 0 1 0 1 0 | 0 0 1 0 0 0 0 0
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.
Comments
Leave a comment