diff options
Diffstat (limited to 'asm/f_status.asm')
-rw-r--r-- | asm/f_status.asm | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/asm/f_status.asm b/asm/f_status.asm deleted file mode 100644 index c07a2f3..0000000 --- a/asm/f_status.asm +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************************/ -/* */ -/* File : f_status.asm /_________/ */ -/* Author : Joe | */ -/* Date : 04/2020 | */ -/* Info : Gets batt status | */ -/* / | */ -/* \ / */ -/* \_____/ */ -/* */ -/****************************************************************************************/ - -/***************/ -/* apm status */ -/* ---------- */ -/* 0: high */ -/* 1: low */ -/* 2: critical */ -/* 3: charging */ -/***************/ - -.text -.extern system -.globl f_status - -f_status: - movq $f_cmd, %rdi - callq system - movq $st_file, %rdi - xorq %rsi, %rsi - xorq %rax, %rax - movb $0x5, %al /* sys_open */ - syscall - jc err - movq %rax, %rdi - movq $buff, %rsi - xorq %rdx, %rdx - xorq %rax, %rax - movb $0x1, %dl - movb $0x3, %al /* sys_read */ - syscall - jc err - xorq %rax, %rax - movb $0x6, %al /* sys_close */ - syscall - xorq %rax, %rax - movb (%rsi), %al - subb $0x30, %al - retq - -err: - xorq %rax, %rax - movb $0xfe, %al - retq - -.data - f_cmd: .asciz "apm -b >/tmp/lowbat.status" - st_file: .asciz "/tmp/lowbat.status" - buff: .byte 0x0, 0x0 |