Author Topic: bin32 compile  (Read 10761 times)

Offline nnnik2

  • Jr. Member
  • *
  • Posts: 2
bin32 compile
« on: December 10, 2013, 09:17:26 PM »
Hi
I've been wondering how do you assemble to 32 bit machine code?
I already tried bin (16 bit only) and win32 with -a option (still getting more stuff)
Yet I would like to assemble to 32 bit machine code.
Is there a better possibility than parsing the listing file?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: bin32 compile
« Reply #1 on: December 10, 2013, 09:57:50 PM »
"-f bin" defaults to 16-bit code. Use "bits 32" or "bits 64" in the source file to get 32- or 64-bit code out of it.

http://www.nasm.us/xdoc/2.10.09/html/nasmdoc7.html#section-7.1

The "-a" switch just skips the preprocessor (no macros), so won't help you. I'm not sure what you mean by "parsing the listing file".

Best,
Frank


Offline nnnik2

  • Jr. Member
  • *
  • Posts: 2
Re: bin32 compile
« Reply #2 on: December 11, 2013, 05:09:51 AM »
Thanks for the India these are good news.
Parsing the listing file:
Use the -l option and extract the contents of this file.