1 2 ; fasm example of using the C library in Unix systems 3 4 ; compile the source with commands like: 5 ; fasm libcdemo.asm libcdemo.o 6 ; gcc libcdemo.o -o libcdemo 7 ; strip libcdemo 8 9 format ELF 10 11 include 'ccall.inc' 12 13 section '.text' executable 14 15 public main 16 extrn printf 17 extrn getpid 18 19 main: 20 call getpid 21 ccall printf, msg,eax 22 ret 23 24 section '.data' writeable 25 26 msg db "Current process ID is %d.",0xA,0