Assembling a .asm file via FASM?

686 Views Asked by At

I downloaded a file for some experimentation and the instructions say

"Download Flat Assembler or If you are on Linux, you may use sudo apt-get install fasm Assemble using the following command fasm main.asm"

I don't know how to do any of this as I'm new to all of this stuff. I don't even know if I should be running FASMW.EXE or FASM.EXE to do it. Neither way seems to do anything, so I'm just confused. Any help would be GREATLY appreciated! I've been working on it for the better part of 2 hours and I just cannot get it to work.

1

There are 1 best solutions below

0
Sep Roland On

I don't even know if I should be running FASMW.EXE or FASM.EXE to do it.

FASMW.EXE is the Integrated Development Environment for FASM. It's your easiest option to create programs with FASM.

  • use fileopen to load the source file eg. "keygen.asm"
  • verify if optionscompiler setupinclude path(s): mentions the path to the header files eg. "C:\fasmw17324\INCLUDE"
  • use runcompile to actually create the executable (no linker involved)

This works like a charm, although the source that you mention produces an executable of 7168 bytes instead of the 6260 bytes that were advertised!


If you're going to use the commandline version FASM.EXE, then make sure that the FASMW.INI file contains the path to the header files in its [Environment] section:

[Environment]
Include=C:\fasmw17324\INCLUDE