FASM COFF Example

Example

The following is an example of a FASM program using console FASM to generate COFF files for Windows applications.

format MS COFF ; Generate COFF (.obj) output

include '%include%/win32ax.inc' ; The standard include library

section '.text' code readable executable

public start ; the entry point specified in your GoLink command line (/entry parameter)
start:

invoke MessageBox,0,_message,_caption,MB_ICONQUESTION+MB_YESNO
cmp eax,IDYES
jne exit

exit:
invoke ExitProcess,0

section '.data' data readable writeable

_message db 'Hello I am a message box',0
_caption db 'Hello there',0