aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-28 19:26:18 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-28 19:26:18 +0200
commita49d7815cc407ab493f229c3389006f03cc78511 (patch)
tree3c5d899e682f6018f564845fcfbe6ddf14991410
parentstill segv (diff)
downloadlowbat-bsd-a49d7815cc407ab493f229c3389006f03cc78511.tar.gz
lowbat-bsd-a49d7815cc407ab493f229c3389006f03cc78511.tar.bz2
lowbat-bsd-a49d7815cc407ab493f229c3389006f03cc78511.tar.xz
lowbat-bsd-a49d7815cc407ab493f229c3389006f03cc78511.tar.zst
lowbat-bsd-a49d7815cc407ab493f229c3389006f03cc78511.zip
Rewrote r_cpyhead
-rw-r--r--asm/r_cpyhead.asm44
1 files changed, 1 insertions, 43 deletions
diff --git a/asm/r_cpyhead.asm b/asm/r_cpyhead.asm
index 397faa4..2e40877 100644
--- a/asm/r_cpyhead.asm
+++ b/asm/r_cpyhead.asm
@@ -13,26 +13,13 @@
.text
.extern sprintf
.globl r_cpyhead
- .extern puts
- .globl main
r_cpyhead:
movq $buff, %rdi
movq $n_head, %rsi
xorq %rax, %rax
callq sprintf
- movq %rdi, %rax
- retq
-
-main:
- movq $25, %rdx
- callq r_cpyhead
- movq %rax, %rdi
- callq puts
-
- xorq %rdi, %rdi
- movq $0x1, %rax
- syscall
+ movq $buff, %rax
retq
.data
@@ -40,32 +27,3 @@ main:
.bss
buff: .zero 0x11
-
-/* ;; 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 */
-/* ;; 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 */