Re: i386 inline assembly
Re: i386 inline assembly
- Subject: Re: i386 inline assembly
- From: email@hidden
- Date: Mon, 16 Jan 2006 00:08:13 -0800
This is going to come up quite a bit with the transition to Intel -
people porting assembly from other environments (particularly
Microsoft's). As you've discovered, there are numerous syntactical
differences between nasm and other popular assemblers. .endm
vs .endmacro is one such. The align semantics is another one. The
nasm documentation - http://nasm.sourceforge.net/doc/html/
nasmdoc0.html - is definitely your friend with these issues.
One major problem I've encountered, as you just have, is that
assembly macros aren't actually supported yet. D'oh. The syntax for
declaring macros is different in nasm, but even if you use the nasm
syntax, it still doesn't work - I presume macro support has to be put
into the MachO backend. This is on my personal todo list, but that
list has some cobwebs on it... I'll try to track down a solution to
this (i.e. make someone else do it :D ), but in the meantime you can
perhaps replace the assembly macros with C ones, or worst case
perform the macro expansion manually - sed [or similar] may be a very
good friend here. :)
Note that nasm (for MacOS X) is being improved rapidly, so you can
try pulling the latest source from Sourceforge - http://
www.sourceforge.net/projects/nasm/ (use the latest from CVS for new
MachO stuff). There will always be a delay between updates going
into nasm's source and Apple shipping the new binaries... with so
many limitations at present, you may need to watch the CVS head
closely. I believe the alignment functionality is already in a
released update - I'll check that tomorrow. Correct alignment is
crucial if you're using SSE2 and similar technologies, which is a
pretty common use of inline x86 assembly.
By all means, if you do have issues with nasm on MacOS X, file bugs
at http://bugreport.apple.com/. As Eric noted, all the issues raised
so far are already known, but extra bug reports help light fires
under key bums. :)
Also, the source to nasm is right there, and it's really not that
complicated... anyone's welcome to add to it. :D
Wade Tregaskis
ICQ: 40056898
AIM, Yahoo & Skype: wadetregaskis
MSN: email@hidden
iChat & email: email@hidden
Jabber: email@hidden
Google Talk: email@hidden
http://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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