global _main
%define SYS_EXIT 0x2000001
%define SYS_WRITE 0x2000004
%define STDOUT 1
%macro sys_write 3
mov rax, SYS_WRITE
mov rdi, %1
mov rsi, %2
mov rdx, %3
syscall
%endmacro
section .data
message: db "Hello, World!", 10
message_len: equ $1 - message
section .text
_main:
sys_write STDOUT message message_len
mov rax, SYS_EXIT
mov rdi, 0
syscall
nasm -fmacho64 main.s
main.s:22: warning: multi-line macro `sys_write' exists, but not taking 1 parameter [-w+pp-macro-params-multi]
main.s:22: error: parser: instruction expected
make: *** [main.o] Error 1