Professional Documents
Culture Documents
ASSIGNMENT NO 2
THEORY:
• DESCRIPTION OF INSTRUCTIONS USED IN THIS CODE –
1. section: This directive is used to define sections of the executable
file. In this code, the data section (.data) is used to define the
string to be printed, and the text section (.text) is used for the
main program.
section .data
msg db "Hello world!", 0ah
section .text
global _start
_start:
mov rax, 1 ;function no.
mov rdi, 1 ;file descriptor for std_out devices
mov rsi, msg ;address of variable
mov rdx, 13 ;count of bytes to display
syscall
mov rax, 60 ;function no. for sys_exit
mov rdi, 0 ;Exit with return code of zero(no error)
syscall
• SCREENSHOT OF OUTPUT-