flat assembler
Message board for the users of flat assembler.

Index > Unix > MacOS X

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
redsock



Joined: 09 Oct 2009
Posts: 430
Location: Australia
redsock 30 Oct 2009, 23:58
Woo!, glad I could be of some assistance getting that ball rolling...

Cheers!
Post 30 Oct 2009, 23:58
View user's profile Send private message Reply with quote
rxantos



Joined: 19 Jul 2008
Posts: 41
rxantos 11 Jul 2010, 01:41
I know the thread is old, but I wanted to say that the latest version (1.69.14 using libc) compiles and runs fine after converting to macho32 format (using agner fog object converter).

The steps:

1. download agner fog object converter from http://www.agner.org/optimize/

2. after unziping it, unzip the source. And compile it using
Code:
g++ -m32 -o objconv -O2 *.cpp
    


The -m32 is necesary on the newest version of Snow Leopard as it defaults to 64 bit compilation. -m32 tells it we want a 32 bit exe.

3. use objconv to convert the fasm.o to macho32 format
Code:
objconv -fmacho32 -nu fasm.o fasm_m.o
    


-fmacho32 Convert to macho32 object format.
-nu Depending the target it eliminates or adds an '_' at the start of symbols. (in this case it added the _ at the start of main)

4. Compile fasm
Code:
gcc -m32 -o fasm fasm_m.o
    


I tested assembling fasm itself and it worked. I guess that the next step would be support for macho32 and macho64 object format on fasm itself.

the macho format is documented at: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html

EDIT:
Unfortunately while the fas tools (listing, prepsrc, symbols) build using this method. They throw a segmentation fault when run. gdb says is because of a misaligned stack.

EDIT:
I feel silly, It was the ccall macro. it was updated for fasm.asm but not for the tools. changing the macro with the one of fasm.asm made them work.
Post 11 Jul 2010, 01:41
View user's profile Send private message Reply with quote
Shirk



Joined: 12 Sep 2011
Posts: 10
Shirk 12 Sep 2011, 09:42
Hi,

I've been successfuly using a fasm binary created with this method on my Snow Leopard 64bit system.
However after upgrading to lion it just won't assemble anything anymore.

I can run fasm just fine (without any input files),
but once I try to assemble some code I end up with:

Code:
flat assembler  version 1.69.32  (16384 kilobytes memory)
error: out of memory
     


I'll try to debug the issue a little further but any help is greatly appreciated.

P.S. yes, I've also tried rebuilding fasm (32bit binary) on lion - same result

Cheers,
Shirk
Post 12 Sep 2011, 09:42
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 14 Sep 2011, 16:47
@Shirk: Two things to try
1) Try to assemble an empty file and then try to assemble "nop"
2) Try modifying memory amount given to FASM

If your "some code" is a macro that generates a lot of memory-traffic so-to-speak, then increasing memory will help.

...and btw, did you notice the date of the previous reply. Maybe they've forgotten all about it Sad
Post 14 Sep 2011, 16:47
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Nikso



Joined: 20 Oct 2003
Posts: 9
Location: Italy
Nikso 29 Nov 2012, 00:49
Tomasz Grysztar wrote:
the Mach-O output format is currently planned for the 1.70 milestone


Are there any update on native Mach-O support?
Post 29 Nov 2012, 00:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
bakedbadger



Joined: 14 Mar 2014
Posts: 2
bakedbadger 14 Mar 2014, 13:38
Bummer.
I just joined this forum today hoping to learn FASM on my Mac. Guess it's out of the question now. I tried but seem to get errors.

I'll stay tuned but Tomasz has already done so much incredible work with this, it seems wrong that nobody has ported it to Mac. It's beyond my capabilities unfortunately. It looks like an amazing assembly language and makes me regret getting a Mac in some ways. Never stray from Linux people. It's the foundation, the bedrock for all decent programming.
Post 14 Mar 2014, 13:38
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12740
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 14 Mar 2014, 17:28
you could install virtualbox or etc virtualization software to get a taste of it, before really tasting it inside macos.
Post 14 Mar 2014, 17:28
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Mar 2014, 04:04
bakedbadger,
Lol I have a Mac, I use Wine. Razz
Btw the IDE works fine with Wine.
Porting fasm to Mac shouldn't be tough, but I have little
experience with the API.
The MachO format is like a disk image, DMG is the extension right? (I think?) which contains application files.
Post 15 Mar 2014, 04:04
View user's profile Send private message Reply with quote
bakedbadger



Joined: 14 Mar 2014
Posts: 2
bakedbadger 15 Mar 2014, 04:18
sid123 wrote:
Lol I have a Mac, I use Wine. Razz
Btw the IDE works fine.


I've used and am familiar with wine (I used to play Battlefield Vietnam on Linux) but making assembler go through a virtualisation layer kind of defeats the purpose for me. Do the assembled files depend on wine too?

Mach does use its own built in assembler - an as and objective c variant - but I can't see it being faster than FASM if it uses obj c.... NASM works fine for Mac so I think I'll go with that for now. My feeling is they're all inferior to FASM.
Post 15 Mar 2014, 04:18
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Mar 2014, 04:28
Yes. Sadly you can't compile native Mac OS programs until now since Mach O executables aren't supported. So they will have to rely on wine.
Post 15 Mar 2014, 04:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 15 Mar 2014, 04:32
sid123 wrote:
... Mach O ...
Why is it that each time I see that I get a "Village People" song in my head? Neutral
Post 15 Mar 2014, 04:32
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 15 Mar 2014, 05:57
bakedbadger wrote:
but making assembler go through a virtualisation layer kind of defeats the purpose for me.


It is a big misunderstanding. In Wine, there is no visualization layer. The code runs natively on the CPU of the computer.

There is API layer, but using GTK or Qt for the GUI is the same. In fact, some programs run in Wine even faster than in Windows.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 15 Mar 2014, 05:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.