FASM compiling help

Via technologies, inc. / Vt8601
May 26, 2009 at 19:58:14
Specs: Microsoft Windows XP Professional, 860 MHz / 119 MB
I just got FASM, because I decided to pick up assembly recently. One problem: whenever I click "run" or compile, the only thing that happens is a new .bin file is made in the directory of the .asm file, and there's nothing I can do with a bin file. I want to be able to convert .asm to .exe or at least run the assembly program as it is.. compile and run are supposed to do that, right?

See More: FASM compiling help

Report •

May 27, 2009 at 03:12:02
I do not know the FASM assembly, but I suppose you need to trig the linkage editor after compiling. To create an executable from source requires two steps

- assembly/compile that generates a binary .bin file;

- linking that puts toghether the .bins previously generated and outputs the executable .exe

Sometime the linkage editor step is hidden in the IDE, but it is required anyway.

Report •

May 28, 2009 at 14:27:42
...Still confused. Linkage editor?

Report •

May 29, 2009 at 05:33:07
YES, Linkage Editor is the program that collects the .bin binary files produced by the assembly or compile phase and generates the final executable .exe module.

That is often forgotten, but a compiler or assembler just translates symbolic text to a raw binary module stil not executable as there are unresolved addresses to work out inside the code. The Linkage Editor does the job converting .bin into .exe.

In the FASM package you downloaded there is, I'm sure, an associated Linkage Editor to perform the described step. And there is a related command in the IDE as Compile translates (.asm into .bin), Run executes (a .exe) and ??? performs linkedit (i.e. from .bin to .exe).

Report •

Related Solutions

May 30, 2009 at 11:38:56
Hmm ok ill look into it. My friend said at the main page for fasm he saw another program for download, i believe that is the 'link editor' i missed as i was in a rush

Report •

May 31, 2009 at 13:22:06
You have to code at the beginning of your asm text the following output directives

format PE GUI 4.0
entry start

where start is the entry point label of the program (start:)..

That generates a Windows executable, but this is just a hint as the full theory of compiled modules is quite complex for a novice. My post about Linkage Editor still right, but FASM can directly generate a simple executable.

Take a look at Examples as a starting point to go on along an impervious lane.

Report •

May 31, 2009 at 16:33:33
THANK YOU SO MUCH! I read about directives in the manual and thought that they might be needed, but I didn't know how to insert the code properly!

Report •

Ask Question