ALP to print Hello World using macro (64-bit)
kw.asm
section .data msg db "Hello, World!",10 msg_len equ $-msg %macro display 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endm section .text global _start _start: display 1,1,msg,msg_len ;Exit System Call mov rax,60 mov rbx,00 syscall
Output
kodingwindow@kw:~$ nasm -felf64 kw.asm
kodingwindow@kw:~$ ld kw.o && ./a.out Hello, World! kodingwindow@kw:~$
Comments and Reactions
What Next?
ALP to print the given string using macro (64-bit)
ALP to print the length of a given string (64-bit)
ALP to reverse a given string (64-bit)
Advertisement