MASM_OSX icon indicating copy to clipboard operation
MASM_OSX copied to clipboard

Please provide instructions for running 64bit MASM

Open kristianmandrup opened this issue 7 years ago • 0 comments

Been scratching my head trying to get some 64bit MASM Assembler working on XCode...

As it is widely advertised, modern x86_64 processors have 64-bit registers that can be used in backward-compatible fashion as 32-bit registers, 16-bit registers and even 8-bit registers, for example:

0x1122334455667788
  ================ rax (64 bits)
          ======== eax (32 bits)
              ====  ax (16 bits)
              ==    ah (8 bits)
                ==  al (8 bits)

So it looks like I don't have the rax register available! Looks like I need to tell Xcode to compile for x64 bit

/usr/local/bin/nasm -f macho64 ${INPUT_FILE_PATH} -o ${SCRIPT_OUTPUT_FILE_0}

I see my Makefile uses 32bit!

If you’d rather create a 32-bit object file, you can supply the -arch i386 parameter which is exactly what I have:

CFLAGS=-Wall -O0 -g -arch i386 -lAlong32 -Llib -Wl,-no_pie

Also could you help me figure out how to link-assembly-routine-with-c-on-osx

Cheers!

kristianmandrup avatar Mar 07 '17 15:03 kristianmandrup