Skip to contentSkip to conversation

Generating 32 bit flat assembly with GNU tools

DISCUSSION Gags Grewal 1 participant 1 message Dec 6, 2002

lore
Share & tools
lore
#0 lore raw

Hi folks!

Am having some problems generating 32bit flat binary using GNU tools. I assemble the code using 'as' ... the code is just fine ... i.e. 32 bit ... but when I change the format from 'elf32-i386' to 'binary' using 'objcopy' ... the code that I get is 16 bit and not 32 bit. Using operand overrides solves the problem to some extent .... but not fully ... ( talk abt inserting override bytes after each instruction in long programs ! )

I dont want to use NASM as it'll be difficult to integrate the code with GCC later on .... ( and examining the code generated by NASM reveals that it uses override bytes to generate 32 bit code ... ??? )

Anybody have a solution ?

Thanks in advance ....

Regards,
Gags.

Signature · 1 line
Ken Rules, Unix Liberates, Linux Unites.