-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9.S
38 lines (29 loc) · 795 Bytes
/
9.S
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
27
28
29
30
31
32
33
34
35
36
37
38
section .data
num dq 16
msg_yes db 'Yes, it is a multiple of 3.', 10
msg_no db 'No, it is not a multiple of 3.', 10
section .text
global _start
_start:
mov rax, [num]
mov rbx, 3
xor rdx, rdx
div rbx
cmp rdx, 0
je is_multiple
mov rax, 1
mov rdi, 1
mov rsi, msg_no
mov rdx, 28
syscall
jmp exit
is_multiple:
mov rax, 1
mov rdi, 1
mov rsi, msg_yes
mov rdx, 27
syscall
exit:
mov rax, 60
mov rdi, 0
syscall