-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrmsg.S
More file actions
43 lines (36 loc) · 851 Bytes
/
Copy patherrmsg.S
File metadata and controls
43 lines (36 loc) · 851 Bytes
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
41
42
43
#define MYCODE
#ifdef MYCODE
// version 1.01 05/27/2022
.arch armv6
.arm
.fpu vfp
.syntax unified
// imports
.extern stderr
.extern fprintf
.text
////////////////////////////////////////////
// void errmsg(char *errormsg) //
// writes error messages to stderr //
////////////////////////////////////////////
.type errmsg, %function
.global errmsg
.equ FP_OFF, 4
errmsg:
push {fp, lr}
add fp, sp, FP_OFF
//get parameters ready to pass to fprintf
mov r1, r0
ldr r0, =stderr
ldr r0, [r0]
//fprintf(stderr, message)
bl fprintf
//return 1
mov r0, 1
sub sp, fp, FP_OFF
pop {fp, lr}
bx lr
.size errmsg, (. - errmsg)
.section .note.GNU-stack,"",%progbits
.end
#endif