Hi,
On Dec 29, 10:50 am, "Paul K. McKneely" <
pkmckne...@sbcglobal.net>
wrote:
>
> I only recently discovered that you can push immediate values
> onto the stack.
Sure, introduced with the 80186.
http://en.wikipedia.org/wiki/80186
> "push" works for byte and "pushw" pushes a word.
No, you can't push only a byte size, and "pushw" isn't really a
mnemonic. Most assemblers just use "push" for all uses.
For instance, try under DEBUG:
push 5
pop al
(hint: it won't work, but "pop ax" is okay)
> I am looking for the syntax for how to push 32-bit value
> and 64-bit value. It appears from reading the AMD64 manuals
> that you can't push a 64-bit value, only a 32-bit value sign-extended
> to 64 bits.
You might want to ask on alt.lang.asm or (moderated) comp.lang.asm.x86
instead as you'll get more responders, esp. since I can't answer for
AMD64. But anyways, I'll quote from (old) NASM 0.98.39's manual:
PUSH reg16 ; o16 50+r [8086]
PUSH reg32 ; o32 50+r [386]
PUSH r/m16 ; o16 FF /6 [8086]
PUSH r/m32 ; o32 FF /6 [386]
PUSH CS ; 0E [8086]
PUSH DS ; 1E [8086]
PUSH ES ; 06 [8086]
PUSH SS ; 16 [8086]
PUSH FS ; 0F A0 [386]
PUSH GS ; 0F A8 [386]
PUSH imm8 ; 6A ib [186]
PUSH imm16 ; o16 68 iw [186]
PUSH imm32 ; o32 68 id [386]