• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NASM with Xcode 3.2 ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NASM with Xcode 3.2 ?


  • Subject: Re: NASM with Xcode 3.2 ?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 11 Oct 2009 19:07:59 +0200


Le 11 oct. 2009 à 18:00, Colin Howarth a écrit :

Hi,

Sorry if this is the wrong list, but I didn't find an assembler- specific one.

I'm trying to get back into assembler. I've never done much of that on Unix machines (being somewhat put off by GNU as's syntax). So I was pleased to see nasm "supported" under Xcode.

The documentation is a bit minimal though, appearing to consist of a man page and the NASM Manual. OK, that sounds like quite a lot of documentation, but I still need a HOWTO or helloworld.nasm to get me started.

Under Xcode I did File->New File... Other: Assembly File.

That creates a .s file.

The assembler didn't like my code. Because it was 'as', not 'nasm'.

OK, rename it to .nasm

The assembler doesn't like the C style comments. OK, delete them.

The assembler (nasm, now) doesn't like the segment _DATA.

OK, replace that with segment .data.

Xcode says there's no rule to make x86_64bit stuff.

OK, go to Target > Inspector > Build > Architecture > Architectures: and choose 32-bit universal. (instead of 64-bit)

Now it compiles, but the bit of code I copied from the NASM Manual (Chapter 8. Writing 32 bit code (Unix...)
crashes with asm misaligned_stack_error.



Any help appreciated. Not especially with the code - I just want to see something on the console :-)



The Mac OS X ABI probably does not match the one used in your book.
The simplest way to find how to write function prolog and epilog is to write a simple function in a C file in Xcode, right clic on the file, and choose "Show Assembly Code".



-- Jean-Daniel




_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NASM with Xcode 3.2 ?
      • From: Colin Howarth <email@hidden>
References: 
 >NASM with Xcode 3.2 ? (From: Colin Howarth <email@hidden>)

  • Prev by Date: Re: Symbol(s) not found error for _vm_region, migrating to Xcode 3.2
  • Next by Date: Re: Should I try to avoid loading principal class of plug-in?
  • Previous by thread: NASM with Xcode 3.2 ?
  • Next by thread: Re: NASM with Xcode 3.2 ?
  • Index(es):
    • Date
    • Thread