| 1 |
bits 64 |
| 2 |
default rel |
| 3 |
|
| 4 |
section .text |
| 5 |
global _start |
| 6 |
_start: |
| 7 |
|
| 8 |
mov rax, 1 ; write syscall |
| 9 |
mov rdi, 1 |
| 10 |
mov rsi, msg |
| 11 |
mov rdx, msglen |
| 12 |
syscall |
| 13 |
|
| 14 |
mov rax, 60 ; exit syscall |
| 15 |
sub rdi, rdi |
| 16 |
syscall |
| 17 |
|
| 18 |
; either of the following lines cause: Error in `nasm': double free or corruption ; Aborted (core dumped) |
| 19 |
foo |
| 20 |
; warning: label alone on a line without a colon might be in error [-w+label-orphan] |
| 21 |
mov r8, r9, r10 |
| 22 |
; error: invalid combination of opcode and operands |
| 23 |
add r8d, byte 80h |
| 24 |
; warning: signed byte exceeds bounds [-w+number-overflow] |
| 25 |
section .data |
| 26 |
msg db "Hello, world!", 10 |
| 27 |
msglen equ $-msg |