"Fossies" - the Fresh Open Source Software Archive

Member "fasm/examples/libcdemo/libcdemo.asm" (9 Feb 2020, 402 Bytes) of package /linux/misc/fasm-1.73.22.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Generic Assembler source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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