| Index | Manual | Download | Source | Macros | Embedded word Case ins.
Sitemap | Links | Forum | Tests | Projects

# lin64hw.htm

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

Format
  Linux 64bit
Platform
  Linux
Build
  euroasm lin64hw.htm
Run
  ./lin64hw.x

            EUROASM CPU=X64
    lin64hw PROGRAM Format=ELFX, Width=64, Entry=Main:
    Main:    PROC
              MOV EAX,1             ; Kernel function sys_write.
              MOV EDI,1             ; STDOUT_FILENO.
              LEA RSI,[Msg]         ; Address of the message.
              MOV EDX,MsgSize       ; Message size.
              SYSCALL               ; Invoke kernel.
              MOV EAX,60            ; Kernel function sys_exit.
              XOR EBX,EBX           ; Errorlevel 0.
              SYSCALL               ; Invoke kernel.
             ENDPROC Main:
    Msg      DB "Hello, world!",10
    MsgSize  EQU $ - Msg
          ENDPROGRAM lin64hw

▲Back to the top▲