push/pushf/pop/popf
The push instructions push the value of the given register onto the stack.
pushf pushes the flags.
The pop instructions pop an 8 bit value from the stack and write it to the given register.
popf pops the flags.
The flags are encoded in an 8 bit value as follows: 0000CVZS
(the sign flag is the least significant bit).
Prefixing these instructions with prefix_a16
results in undefined behavior.
(The values would be written to or read from IO devices.)
Instruction | Encoding | Semantics | Cycles |
---|---|---|---|
push reg8 1 | 00 rrr 100 | 4 | |
pushf | 00 110 100 | 4 | |
pop reg8 1 | 00 rrr 101 | 4 | |
popf | 00 110 101 | 4 |
reg8
may not be[pi]
(rrr
=110
).