diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-17 18:40:13 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-17 18:40:13 +0200 |
commit | 3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24 (patch) | |
tree | 0fab45ba8a0b1bce3c85241e477a15fff70f5c73 | |
parent | aaaaaaaaa ok (diff) | |
download | lowbat-bsd-3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24.tar.gz lowbat-bsd-3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24.tar.bz2 lowbat-bsd-3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24.tar.xz lowbat-bsd-3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24.tar.zst lowbat-bsd-3eb2b353ccce59f0b09b5b3c56caac5be6bbbb24.zip |
in progress
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | asm/jo_r_loop.asm | 17 | ||||
-rw-r--r-- | asm/jo_r_lowbat.asm | 35 | ||||
-rw-r--r-- | src/jo_lowbat.h | 2 |
4 files changed, 36 insertions, 21 deletions
@@ -22,6 +22,7 @@ C_SRCS += ${C_SRCS_DIR}/jo_n_notify.c C_OBJS = ${C_SRCS:.c=.o} # -------------------------------------------------------------------------------------- # A_SRCS = ${A_SRCS_DIR}/jo_r_lowbat.asm +A_SRCS += ${A_SRCS_DIR}/jo_r_loop.asm A_SRCS += ${A_SRCS_DIR}/jo_c_args.asm A_SRCS += ${A_SRCS_DIR}/jo_f_status.asm A_SRCS += ${A_SRCS_DIR}/jo_f_percent.asm @@ -87,7 +88,7 @@ ${TARGET}: ${A_OBJS} ${C_OBJS} # -------------------------------------------------------------------------------------- # depend: ${CC} ${CINCS} -E -MM ${C_SRCS} > .depend - ${SED} 's/^/${C_SRCS_DIR}\//' .depend > .depend.tmp + ${SED} 's/^jo/${C_SRCS_DIR}\/jo/' .depend > .depend.tmp ${MV} .depend.tmp .depend # -------------------------------------------------------------------------------------- # all: diff --git a/asm/jo_r_loop.asm b/asm/jo_r_loop.asm new file mode 100644 index 0000000..02753f5 --- /dev/null +++ b/asm/jo_r_loop.asm @@ -0,0 +1,17 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; File : jo_r_loop.asm /_________/ ;; +;; Author : Joe | ;; +;; Date : 04/2020 | ;; +;; Info : The main loop | ;; +;; / | ;; +;; \ / ;; +;; \_____/ ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +section .text + global jo_r_loop + +jo_r_loop: + retq diff --git a/asm/jo_r_lowbat.asm b/asm/jo_r_lowbat.asm index 9753a12..6fadc86 100644 --- a/asm/jo_r_lowbat.asm +++ b/asm/jo_r_lowbat.asm @@ -19,32 +19,29 @@ section .text extern puts - extern jo_n_speak + ;; extern stoa extern jo_c_args + extern jo_r_loop global jo_r_lowbat jo_r_lowbat: - call jo_c_args - cmp rax, 0x0 - jne joprint + ;; call stoa 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 rdi, rax call puts - pop rsi pop rdi retq -section .data - msg: db "Welcome back, partner!", 0x0 - ;; fmt: db "argv[2]: %s\n", 0x0 +;; call jo_c_args +;; mov bl, byte [rax + 0x0] +;; cmp bl, 0x0 +;; jne joprint +;; call jo_r_loop ; jo_r_loop(speak: 0-1, *argv[]) +;; xor rax, rax +;; retq + +;; joprint: +;; push rdi +;; mov rdi, rax +;; call puts +;; pop rdi diff --git a/src/jo_lowbat.h b/src/jo_lowbat.h index b19fa28..e56903a 100644 --- a/src/jo_lowbat.h +++ b/src/jo_lowbat.h @@ -16,10 +16,10 @@ #include <jo_lowbat.h> #include <jo_n_speak.h> #include <jo_n_notify.h> -#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <stdint.h> +#include <stdio.h> enum { |