Hi there,

I posted this example at www.vbforums.com to lure some people interested in assembly. May be they'll turn up here. I'm waiting. Privalov has done a lot of work for the FASM macro subsystem, so i've tried to keep this example as simple as possible using his macros. I decided to post this here for newbies so here goes:

Downloading and installing FASM
1. Download FASM for Windows Console and for Windows GUI from http://www.flatassembler.net.
2. First unzip console version into C:\fasm folder.
3. Then unzip GUI version into C:\fasm folder
4. Open all the files in a Multitab editor (e.g. TextPad) and replace in all text (.asm, .inc) files (in the fasm folder) the word "%include%" with "%fasminc%", otherwise egs may not work.

You should have this directory structure:


5. Before you start fiddling with the examples or my example, set this "fasminc" environment variable (specifies where the header files will be found):

For Windows 9x at this to autoexec.bat:
set fasminc=C:\fasm\include

(without the ending seperators ';' or '\' )

For Windows 2000/XP set this environment variables dialog:
a. Create new variable named "fasminc"
b. Add this path "C:\fasm\include", without the ending seperators ';' or '\', to this variable.

A bludy simple example
You're now ready to compile and run programs. We will use only the console version of the assembler. Put this into a plain-text file named "showmsg.asm".

A point to be noted is that this is an extremely simple program and there are macros hiding the background stuff that goes on, so this is only a starting point.

Remember Case is sensitive.

INCLUDE "%fasminc%\win32ax.inc"


MsgCaption DB "Hello",0
MsgBoxText DB "win32asm is cool",0

.code ; case-sensitive not equal to .CODE or .Code


invoke MessageBox, NULL, MsgBoxText, MsgCaption, MB_OK
invoke MessageBox, NULL, "Hello, World!", "M$ Windoze", MB_OK + MB_ICONEXCLAMATION
invoke ExitProcess, 0


Compile this using the following command at the command prompt.

fasm showmsg.asm showmsg.exe

Posted on 2003-12-01 08:07:11 by art_sands