aboutsummaryrefslogtreecommitdiffstats
path: root/asm/r_cpyhead.asm
blob: 15b0d9e5a968e8f7ce99df2462efd9a0c70d09d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************************ */
/*                                                                                      */
/*  File     : 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
	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