
Instruction Set
4-186
PUSHF Push Flags onto Stack
PUSHF
What It Does
PUSHF creates storage space for a component on the stack and then copies the Processor
Status Flags (FLAGS) register to the stack.
Syntax
Description
PUSHF decrements the stack pointer by 2 and copies the FLAGS register to the new top
of stack.
Operation It Performs
Flag Settings After Instruction
Tips
Before you use PUSHF, use MOV to copy the stack segment to SS and the stack offset to
SP.
To prevent an instruction or a called procedure from modifying flags that are necessary for
the successful execution of the following instructions or calling procedure, use PUSHF to
save the Processor Status Flags register. After the instruction or the procedure call, use
POPF to restore the saved flags.
Related Instructions
Form
Opcode
Description
Clocks
Am186 Am188
PUSHF
9C
Push Processor Status Flags register
9
13
If you want to
See
Copy the low byte of the Processor Status Flags register to AH
LAHF
Pop a component from the stack into the Processor Status Flags register
POPF
Push a component onto the stack
PUSH
Push the 16-bit general registers onto the stack
PUSHA
PUSHF
/* create storage on stack */
SP = SP - 2;
/copy flags to stack */
SS:[SP] = FLAGS;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...