aboutsummaryrefslogtreecommitdiff
path: root/src/exceptions/undefined.S
blob: ef0073543200bbbe1bb7be69e521e1e229a7422f (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
.section ".text.exceptions"
.globl undefined
undefined:
	cpsid aif
	stmfd sp!, {r0-r12,lr}
	ldr r4, [lr, #-4]
	mov r0, #0
	mov r1, #17
	ldr r2, =undefined_msg
	bl draw_string
	mov r0, #18
	mov r1, #17
	mov r2, r4
	bl draw_hex32
	mov r0, #27
	mov r1, #17
	ldr r2, =undefined_at
	bl draw_string
	// Output lr
	ldr r0, [sp, #0x34]
	sub r2, r0, #4
	mov r0, #31
	mov r1, #17
	bl draw_hex32
	// Skip instruction for now
	// In future, 
	//  ldmfd sp!, {r0-r12,lr} // Note the lack of ^ since subs will handle it
	//  subs pc, lr, #4
	ldmfd sp!, {r0-r12,pc}^

.section .data
undefined_msg:	.asciz "Undefined Handler"
undefined_at:	.asciz "@ 0x"