Here is a small example demonstrating the use of Masm32.lib with Fasm

format MS COFF

include 'include\'
include 'include\'
include 'include\macro\'
include 'include\macro\'

real8 equ dq

section '.data' data readable writeable

msg db 'This is a linking example for Fasm',13,10,0
buffer rb 256
number real8 3.141592
m1 db 13,10,'This ',0
m2 db 'is a ',0
m3 db 'szMultiCat example.',13,10,0
m4 db 'PI=',0
section '.code' code readable executable

public _start

call ClearScreen
stdcall ucase,msg
stdcall StdOut,msg
stdcall StdOut,m4
mov esi,number
stdcall FloatToStr,dword [esi],dword [esi+4],buffer
stdcall StdOut,buffer
stdcall memfill,buffer,256,0
ccall szMultiCat,3,buffer,m1,m2,m3
stdcall StdOut,buffer
invoke ExitProcess,0

The assembling and linking process:

fasm Sample.asm Sample.obj
\masm32\bin\link /ENTRY:start /SUBSYSTEM:CONSOLE Sample.obj /IGNORE:4089
/LIBPATH:C:\masm32\lib kernel32.lib user32.lib masm32.lib

The file is based on my modest work:


Posted on 2003-02-06 09:29:50 by Vortex