Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
Creations
Programming
Fasm for OS X
1
Print
Topic: Fasm for OS X
(Read 5151 times)
previous topic
-
next topic
0 Members and 2 Guests are viewing this topic.
Flying Jester
Legendary Poster
Posts: 1,161
Logged
TurboSphere Developer
Fasm for OS X
July 30, 2014, 01:52:31 pm
My favorite assembler by far is FASM (the Flat Assembler). Generally, I don't do very much ASM work, but I prefer FASM because it makes it extremely simple to link the object files it generates with C/C++ projects simply using my C/C++ linker.
It's also very nice that is an extremely in-depth x86 (16 and 32 bit) and amd64 assembly guide, complete with an entire listing of instructions,
included with it
.
FASM isn't distributed for OS X, but a 'blank' assembled ELF32 object file is for Unix-like OS's. After a little work, and using
Agner Fog's object converter
, I managed to get this converted to the native Mach-O format of OS X, change its symbols to use underscores (since basically all C libraries require/expect this). After that, it was a simple matter to link the resulting object file, and get a working FASM executable.
Any files created with it would have to be converted to Mach-O to be used with Clang/LLVM, but that's simple with objconv. And given that, if you get to that point, you just wrote a bunch of ASM and are linking it with a native C/C++ project, I doubt that adding a builder definition to your build scripts would be too complex to handle
I've looked around, and I can't find any other place where this process is detailed, and I found lots of unanswered questions when DuckDuckGo'ing for 'Fasm for OS X'. So if I'm not the first to get this working, whoever else has done it isn't talking about it.
A copy of the OS X Fasm executable, along with the source, the intermediate files, and full instructions on how to build it yourself can be found at
https://github.com/FlyingJester/fasm
.
Last Edit
: July 30, 2014, 01:56:00 pm by Flying Jester
Learn some history?
The Flying Jester's Blog of Sorts
1
Print
Creations
Programming
Fasm for OS X