Assembly Language StepbyStep Programming with DOS and Linux 2nd Ed [Electronic resources]

Jeff Duntemann

نسخه متنی -صفحه : 166/ 118
نمايش فراداده

PUSH Push Operand onto Top of Stack

Flags affected:

O D I T S Z A P C  OF: Overflow flag  TF: Trap flag AF: Aux carry
F F F F F F F F F  DF: Direction flag SF: Sign flag PF: Parity flag
<none>         IF: Interrupt flag ZF: Zero flag CF: Carry flag

Legal forms:

PUSH r16
PUSH m16
PUSH r32        386+
PUSH m32        386+
PUSH sr
PUSH i8         286+
PUSH i16        286+
PUSH i32        386+

Examples:

PUSH WORD [BX]
PUSH EAX
PUSH DI
PUSH ES
PUSH DWORD 5
PUSH WORD 1000H

Notes:

It is impossible to push an 8-bit item onto the stack. Also remember that the top of the stack is defined (in 16-bit modes) as the word at address SS:SP, and there's no way to override that using prefixes. In 32-bit modes the top of the stack is the DWORD at [ESP]. There is a separate pair of instructions, PUSHF and POPF, for pushing and popping the Flags register.

Also remember that SP/ESP is decremented before the push takes place; SP points to either an empty stack or else real data.

r8 = AL AH BL BH CL CH DL DH        r16 = AX BX CX DX BP SP SI DI
sr = CS DS SS ES FS GS              r32 = EAX EBX ECX EDX EBP ESP ESI EDI
m8 = 8-bit memory data              m16 = 16-bit memory data
m32 = 32-bit memory data            i8 = 8-bit immediate data
i16 = 16-bit immediate data         i32 = 32-bit immediate data
d8 = 8-bit signed displacement      d16 = 16-bit signed displacement
d32 = 32-bit unsigned displacement