Mail Archives: djgpp/1997/11/17/03:16:18
Prev. Author: grbhat AT unigoa DOT ernet DOT in
Date: 13.11.97
Subject:"Bug in NASM (possibly old)"
> When I push a segment register
> push cs
> the stack pointer gets decremented by 4 instead of 2.
This is *not* a bug when you're in 32 bit mode! When you have a RETF it will
at least remove 8(!) bytes (instead of 6) from the stack. Pls. take a look at
Intels 386+ documentation ...
BTW: "mov eax,cs" works in 32bit PM too! Faster than a "mov ax,cs // movzx
eax,ax"!
> If any NASM watcher/user has a patch for this, I
> would be grateful for pointers.
Perhaps: o16 push cs
.. or: db 66h
push cs
The "o16 push cs" is the 'more compatible' form that allows easy switching of
the caller from 16bit to 32bit PM because the 66h prefix will only be
generated when in 32bit mode.
Regards, MJS
Use it: _PB3.2 & PREP_ / _ASM & PREASM_
- Raw text -