-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassemblyError.S
More file actions
26 lines (18 loc) · 827 Bytes
/
assemblyError.S
File metadata and controls
26 lines (18 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Shivam Mevawala Assembly problem 4
.text # section declaration
.global _start
_start:
#sys_write
movq $1,%rax # system call number (sys_write)
movq $1,%rdi # first argument: file handle (stdout)
movq $9001,%rsi # second argument: pointer to message to write
movq $length,%rdx # third argument: message length
syscall # call kernel
# and exit
movq $60,%rax # system call number (sys_exit)
movq $1,%rdi # first argument: exit code
syscall # call kernel
.data # section declaration
msg:
.ascii "Hello world!\n" # our dear string
length = . - msg # length of our dear string