RicardasSim icon

nasm syscall

RicardasSim | PRO | 09/03/19 06:09:56 AM UTC | 0 ⭐ | 13172 👁️ | Never ⏰ | []
ASM (NASM) |

0 B

|

None

|

0 👍

/

0 👎

;64 bit
;nasm -f elf64 main.asm -o main.o
;ld main.o -o test
 
section .data
    msg: db "Hello World !", 10
    msgLen: equ $-msg
 
section .text
global _start
 
_start:
    mov rax, 1      ; sys_write
    mov rdi, 1      ; write to stdout
    mov rsi, msg    ; string address
    mov rdx, msgLen ; size of string
    syscall         ; syscall
    
    mov rax, 60     ; sys_exit
    mov rdi, 0      ; return code 0
    syscall         ; syscall

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎