diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-18 21:36:37 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-18 21:36:37 +0200 |
commit | 20c5cfb47c32b0c4f0f1050b457cde869462014a (patch) | |
tree | d427471d1e4c67993b2d21ffa4d757aecc149ea6 /asm/jo_r_cpyhead.asm | |
parent | Something is not quite right (diff) | |
download | lowbat-bsd-20c5cfb47c32b0c4f0f1050b457cde869462014a.tar.gz lowbat-bsd-20c5cfb47c32b0c4f0f1050b457cde869462014a.tar.bz2 lowbat-bsd-20c5cfb47c32b0c4f0f1050b457cde869462014a.tar.xz lowbat-bsd-20c5cfb47c32b0c4f0f1050b457cde869462014a.tar.zst lowbat-bsd-20c5cfb47c32b0c4f0f1050b457cde869462014a.zip |
Finished main program
Diffstat (limited to 'asm/jo_r_cpyhead.asm')
-rw-r--r-- | asm/jo_r_cpyhead.asm | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/asm/jo_r_cpyhead.asm b/asm/jo_r_cpyhead.asm new file mode 100644 index 0000000..421b17c --- /dev/null +++ b/asm/jo_r_cpyhead.asm @@ -0,0 +1,40 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; File : jo_r_cpyhead.asm /_________/ ;; +;; Author : Joe | ;; +;; Date : 04/2020 | ;; +;; Info : Formats and returns notification head title | ;; +;; / | ;; +;; \ / ;; +;; \_____/ ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +section .text + extern memset + extern sprintf + global jo_r_cpyhead + +jo_r_cpyhead: ; jo_r_cpyhead(percent: rdi) + push rdi + mov rdi, buff + mov rsi, 0x0 + mov rdx, 0x11 ; 17 + call memset ; memset 0 notification head + lea rsi, [rel n_head] + pop rdi + mov rdx, rdi + mov rdi, rax + xor rax, rax + mov al, 0x1 + push rdi + call sprintf + pop rdi + mov rax, rdi + retq + +section .data + n_head: db "Low battery: %d%%", 0x0 + +section .bss + buff: resb 0x11 ; 17, notification head len |