-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path13.S
More file actions
36 lines (27 loc) · 651 Bytes
/
Copy path13.S
File metadata and controls
36 lines (27 loc) · 651 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
27
28
29
30
31
32
33
34
35
36
section .data
positive_msg db "Positive", 10
positive_len equ $ - positive_msg
negative_msg db "Negative", 10
negative_len equ $ - negative_msg
section .text
global _start
_start:
mov rax, -42
cmp rax, 0
jl print_negative
mov rax, 1
mov rdi, 1
mov rsi, positive_msg
mov rdx, positive_len
syscall
jmp exit
print_negative:
mov rax, 1
mov rdi, 1
mov rsi, negative_msg
mov rdx, negative_len
syscall
exit:
mov rax, 60
xor rdi, rdi
syscall