section .data ;Data section to declare constants, messages
m1 db 10,"Hello World!" ;Hello Word" ; message declaration with define byte(db) 10 for new line
l1 equ $- m1
m2 db 10,"I am Abhishek Masali"
l2 equ $- m2 ; length of the message (l1)
section .text ; main program section
global _start
_start:
;------------------------ print message code -------------------------------------------------------------------
mov rax, 1 ; system call for write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, m1 ; address of string to output
mov rdx, l1 ; number of bytes
syscall ; invoke operating system to do the write
mov rax, 1 ; system call for write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, m2 ; address of string to output
mov rdx, l2 ; number of bytes
syscall
;----------------------------- exit code---------------------------------------------------------------------------
mov rax, 60 ; system call for exit
mov rdi, 0 ; exit code 0
syscall ; invoke operating system to exit
To embed this program on your website, copy the following code and paste it into your website's HTML: