Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide instructions for running 64bit MASM #3

Open
kristianmandrup opened this issue Mar 7, 2017 · 0 comments
Open

Please provide instructions for running 64bit MASM #3

kristianmandrup opened this issue Mar 7, 2017 · 0 comments

Comments

@kristianmandrup
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant