Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1627

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

PUSHF/PUSHFD—Push EFLAGS Register onto the Stack
Opcode
9C
9C
Description
Decrement the stack pointer by 4 (if the current operand-size attribute is 32) and push
the entire contents of the EFLAGS register onto the procedure stack or decrement the
stack pointer by 2 (if the operand-size attribute is 16) push the lower 16 bits of the
EFLAGS register onto the stack. (These instructions reverse the operation of the
POPF/POPFD instructions.)
When copying the entire EFLAGS register to the stack, bits 16 and 17, called the VM
and RF flags, are not copied. Instead, the values for these flags are cleared in the
EFLAGS image stored on the stack.
The PUSHF (push flags) and PUSHFD (push flags double) mnemonics reference the
same opcode. The PUSHF instruction is intended for use when the operand-size
attribute is 16 and the PUSHFD instruction for when the operand-size attribute is 32.
Some assemblers may force the operand size to 16 when PUSHF is used and to 32
when PUSHFD is used. Others may treat these mnemonics as synonyms
(PUSHF/PUSHFD) and use the current setting of the operand-size attribute to
determine the size of values to be pushed from the stack, regardless of the mnemonic
used.
When the I/O privilege level (IOPL) is less than 3 in virtual-8086 mode, the
PUSHF/PUSHFD instructions causes a general protection exception (#GP). The IOPL is
altered only when executing at privilege level 0. The interrupt flag is altered only when
executing at a level at least as privileged as the IOPL. (Real-address mode is equivalent
to privilege level 0.) If a PUSHF/PUSHFD instruction is executed with insufficient
privilege, an exception does not occur, but the privileged bits do not change.
In the real-address mode, if the ESP or SP register is 1, 3, or 5 when the
PUSHA/PUSHAD instruction is executed, the processor shuts down due to a lack of
stack space. No exception is generated to indicate this condition.
Operation
IF VM=0 (* Not in Virtual-8086 Mode *)
THEN
IF OperandSize = 32
FI;
ELSE (* In Virtual-8086 Mode *)
IF IOPL=3
Volume 4: Base IA-32 Instruction Reference
Instruction
PUSHF
PUSHFD
THEN
push(EFLAGS AND 00FCFFFFH);
(* VM and RF EFLAG bits are cleared in image stored on the stack*)
ELSE
push(EFLAGS); (* Lower 16 bits only *)
THEN
IF OperandSize = 32
Description
Push EFLAGS
Push EFLAGS
4:325

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents