EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

lin32hw.htm

This sample program for 32bit Linux writes "Hello, world!" and terminates.

Format
Linux 32bit
Platform
Linux
Build
euroasm lin32hw.htm
Run
./lin32hw.x
See also
lin64hw.htm.
        EUROASM
lin32hw PROGRAM Format=ELFX, Width=32, Entry=Main:
Main:    PROC
          MOV EAX,4             ; Kernel function sys_write.
          MOV EBX,1             ; STDOUT_FILENO.
          MOV ECX,Msg           ; Address of the message.
          MOV EDX,MsgSize       ; Message size.
          INT 0x80              ; Invoke kernel.
          MOV EAX,1             ; Kernel function sys_exit.
          XOR EBX,EBX           ; Errorlevel 0.
          INT 0x80              ; Invoke kernel.
         ENDPROC Main:
Msg      DB "Hello, world!",10
MsgSize  EQU $ - Msg
      ENDPROGRAM lin32hw

▲Back to the top▲