This How-To applies to both 32-bit and 64-bit Windows Operating System.
- Download fasm for Windows
What you’ll get is the file fasmw17122.zip, as indicated by the description in the website, this file contains the following:
FASM.PDF is the complete manual, a very valuable resource for FASM Assembly Language programmers. Also included is the Flat Assembler Editor for where you can create and edit your assembly language programs.
- Extract fasmw17122.zip file in your hard drive. I extracted mine in drive C:\fasm you should be able to see something like below:
- Include c:\fasm in your path so you can use it anywhere in your Command Line Interface (CLI) prompt; or as usually called, DOS prompt.
From the desktop, Right click on “Computer” then select “Properties”
Click on “Advanced system settings”
Select the “Advanced” tab and click on the “Environment Variables…” button
Under the “User variables for …” find and select the “PATH” environment variable then click the “Edit…” button
In the “Edit User Variable” dialog, and the path to fasm at the end as shown below (make sure you put it after the “;” semi-colon).
Then click the “Ok” button. Make sure you click “Ok” also from the previous dialog boxes. If everything works fine, you should be able to run fasm anywhere from the command line.
- Lastly, to be able to program in Windows using fasm, you must also add its include files in the environment variables called “include” because fasm doesn’t know where its include files are located. To do this, repeat the same steps above when you add the path to fasm, but this time you’ll edit the “include” variable in user environment. If there’s no such variable yet, just create it and it’ll work just the same.
This time, I put the C:\fasm\INCLUDE first in the line, but you can also add it at the end as long as it would not conflict with other includes. Make sure that paths are separated by semi-colon because that’s the delimiter, otherwise Windows will get confused. Then click the “Ok” button in all these dialog boxes for the changes to take effect.
- To test, open your command prompt and go to where the example “HELLO.ASM” is located. In my case, it’s in C:\fasm\EXAMPLES\HELLO. Compile it by typing
If everything is ok, you should see “HELLO.EXE”
Typing “hello” at the prompt should execute the program and produce the following output:
That’s it! I hope this helps. Cheers! 😀