aboutsummaryrefslogtreecommitdiffstats
path: root/asm/jo_r_lowbat.asm
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-17 18:14:42 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-17 18:14:42 +0200
commit9f46f4559625d62bd8d289e9ac75dc6369d7e7ed (patch)
tree4342a73e97ba98504a806645aea81de1336b862d /asm/jo_r_lowbat.asm
parentStarting the main program, bus error somehow (diff)
downloadlowbat-bsd-9f46f4559625d62bd8d289e9ac75dc6369d7e7ed.tar.gz
lowbat-bsd-9f46f4559625d62bd8d289e9ac75dc6369d7e7ed.tar.bz2
lowbat-bsd-9f46f4559625d62bd8d289e9ac75dc6369d7e7ed.tar.xz
lowbat-bsd-9f46f4559625d62bd8d289e9ac75dc6369d7e7ed.tar.zst
lowbat-bsd-9f46f4559625d62bd8d289e9ac75dc6369d7e7ed.zip
Still bus error, it's not willing to print
Diffstat (limited to 'asm/jo_r_lowbat.asm')
-rw-r--r--asm/jo_r_lowbat.asm31
1 files changed, 27 insertions, 4 deletions
diff --git a/asm/jo_r_lowbat.asm b/asm/jo_r_lowbat.asm
index 42863b4..5c9b2b7 100644
--- a/asm/jo_r_lowbat.asm
+++ b/asm/jo_r_lowbat.asm
@@ -10,18 +10,41 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Files prefixes
+;; --------------
+;; f: fetch
+;; n: notify
+;; r: run
+;; c: check
+
section .text
- extern sleep
+ extern printf
extern jo_n_speak
+ extern jo_c_args
global jo_r_lowbat
jo_r_lowbat:
- mov rdi, 0x2
- call sleep
+ call jo_c_args
+ cmp rax, 0x0
+ jne joprint
+ push rdi
mov rdi, msg
call jo_n_speak
+ pop rdi
xor rax, rax
+ mov rax, rdi
+ retq
+
+joprint:
+ push rdi
+ push rsi
+ mov rdi, fmt
+ mov rsi, rax
+ call printf
+ pop rsi
+ pop rdi
retq
section .data
- msg: db "Welcome back, partner", 0x0
+ msg: db "Welcome back, partner!", 0x0
+ fmt: db "argv[2]: %s\n", 0x0