"Fossies" - the Fresh Open Source Software Archive

Member "fasm/examples/elfobj/msgdemo.asm" (9 Feb 2020, 404 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 demonstration of assembling object files
    3 
    4 ; compile the program using commands like:
    5 ;   fasm msgdemo.asm msgdemo.o
    6 ;   fasm writemsg.asm writemsg.o
    7 ;   ld msgdemo.o writemsg.o -o msgdemo
    8 
    9 format ELF
   10 
   11 section '.text' executable
   12 
   13  public _start
   14  _start:
   15 
   16  extrn writemsg
   17 
   18     mov esi,msg
   19     call    writemsg
   20 
   21     mov eax,1
   22     xor ebx,ebx
   23     int 0x80
   24 
   25 section '.data' writeable
   26 
   27  msg db "Elves are coming!",0xA,0