hello program

singage · updated May 08, 2022
section .data
msg1 db "my name is abhijit singh",10 ;10/0ahis for break line 
msg1_len equ $-msg1

msg2 db "i am learning macro in this tutorial"
msg2_len equ $-msg2



%macro print 2   ;print is name and 2 is number of arguments

mov rax,1 ;sys call 1 to write
mov rdi,1 ;sys call for stdout
mov rsi, %1 ;% is same like & in c++,which drepresents adress of 1st arguments
mov rdx ,%2 ;same like above
syscall
%endmacro



section .text
     global _start
_start:

print msg1,msg1_len
print msg2,msg2_len



mov rax,60   ;program to exit 
mov rdi,0
syscall
Output

Comments

Please sign up or log in to contribute to the discussion.