64bit and 32bit elf together
Vikas Kumar
walburn at gmail.com
Sun Feb 5 12:04:13 PST 2006
Hi
If I write an assembly program for an AMD64 processor system, where I
want to use both 64-bit and 32-bit compatible instructions, is there a
special way I need to build it.
For example, the instruction "pusha" works in 32-bit mode and not in
64-bit mode.
If I use the instruction directly in my program I get an invalid instruction.
I am compiling with yasm using "yasm -f elf file.asm". So how do I
use the REX prefix 66h before this instruction to change the bit mode
to 32 instead of 64 dynamically ?
Is there some directive or do I have to actually use the instruction
value directly ?
I am a newbie to 64-bit assembly programming and I am having some
difficulty porting my IA-32 programs to AMD64, for the reason that I
want to use 32-bit compatible instructions in some places of the code
and 64-bit compatible instructions in the rest of the code.
Any help will be appreciated !
Regards,
Vikas
More information about the yasm-devel
mailing list