hi all. im probably missing something really simple here but i cant seem to work out how to assemble a 64 bit exe file from asm source.
i have tried nasm and fasm so far and i cant find anything in the doc about outputting 64 bit. for example, nasm has the format option -fwin32 but i cant find and equivalent like fwin64. can anyone shed some light?
assembling a 64bit exe on windows?
Re: assembling a 64bit exe on windows?
Have you tried the documentation?
I mean, I've never used NASM myself before, but it took me one google (to find the NASM homepage), three clicks and a Ctrl-F, "64" to find this (on the "bin" output format page):
OK, enough of the mockery. Sorry, didn't mean to sound offensive. But the important lesson to be learned here: Do read the documentation of your toolchain. Personally, for OS development I'd even recommend reading it in full, not only the parts you think you need, as there are always surprising things to be found in TFM.
I mean, I've never used NASM myself before, but it took me one google (to find the NASM homepage), three clicks and a Ctrl-F, "64" to find this (on the "bin" output format page):
Only a few seconds later I found -f win64 and -f elf64. Gosh, there's even a whole chapter on writing 64-bit code...Using the bin format puts NASM by default into 16-bit mode (see section 6.1). In order to use bin to write 32-bit or 64-bit code, such as an OS kernel, you need to explicitly issue the BITS 32 or BITS 64 directive.
OK, enough of the mockery. Sorry, didn't mean to sound offensive. But the important lesson to be learned here: Do read the documentation of your toolchain. Personally, for OS development I'd even recommend reading it in full, not only the parts you think you need, as there are always surprising things to be found in TFM.
Every good solution is obvious once you've found it.
Re: assembling a 64bit exe on windows?
ahh. looks like i was reading the wrong documentation. thanks. and yes, lesson learnt.