-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhealth.asm
93 lines (82 loc) · 1.05 KB
/
health.asm
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
section .data
eat: DB "What did you eat?: "
eatlen: EQU $ - eat
exer: DB "Which exersice have you done?: "
exerlen: EQU $ - exer
yeat: DB "You eated: "
yeatlen: EQU $ - yeat
yex: DB "You exersised: "
yexlen: EQU $ - yex
section .bss
diet RESB 80
ex RESB 80
section .text
global _start
_start:
CALL _et
CALL _diet
CALL _exer
CALL _ex
CALL _di
CALL _youd
CALL _eaat
CALL _youe
MOV rax, 0x3C
MOV rdi, 0x0
SYSCALL
_et:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, eat
MOV rdx, eatlen
SYSCALL
RET
_diet:
MOV rax, 0x0
MOV rdi, 0x0
MOV rsi, diet
MOV rdx, 80
SYSCALL
RET
_exer:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, exer
MOV rdx, exerlen
SYSCALL
RET
_ex:
MOV rax, 0x00
MOV rdi, 0x00
MOV rsi, ex
MOV rdx, 80
SYSCALL
RET
_di:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, yeat
MOV rdx, yeatlen
SYSCALL
RET
_youd:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, diet
MOV rdx, 80
SYSCALL
RET
_eaat:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, yex
MOV rdx, yexlen
SYSCALL
RET
_youe:
MOV rax, 0x01
MOV rdi, 0x01
MOV rsi, ex
MOV rdx, 80
SYSCALL
RET