Results 1 to 1 of 1

Thread: A simple example: Message Boxes

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    24

    A simple example: Message Boxes

    Hi there,

    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:

    C:\fasm\
    - INCLUDE
    - SOURCE
    - EXAMPLES

    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.

    Code:
    INCLUDE "%fasminc%\win32ax.inc"
    
    .data
    
        MsgCaption      DB "Hello",0
        MsgBoxText      DB "win32asm is cool",0
        
    .code            ; case-sensitive not equal to .CODE or .Code
    
    WIN_START:
    
        invoke  MessageBox, NULL, MsgBoxText, MsgCaption, MB_OK
        invoke  MessageBox, NULL, "Hello, World!", "M$ Windoze", MB_OK + MB_ICONEXCLAMATION
        invoke  ExitProcess, 0
    
    .end WIN_START
    Compile this using the following command at the command prompt.

    Code:
    fasm showmsg.asm showmsg.exe
    More comin later (only if requested).

    Regards,
    Art
    Last edited by art_sands; Dec 1st, 2003 at 08:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width