2022-03-19 05:59:51 +01:00
|
|
|
; panic routines
|
|
|
|
|
2022-06-24 00:42:56 +02:00
|
|
|
; panic invoke the monitor
|
2022-03-19 05:59:51 +01:00
|
|
|
; inputs:
|
|
|
|
; r0: pointer to null-terminated string, or zero for none
|
|
|
|
; outputs:
|
|
|
|
; none, does not return
|
|
|
|
panic:
|
2022-10-28 04:10:03 +02:00
|
|
|
push r0
|
2022-03-19 05:59:51 +01:00
|
|
|
cmp r0, 0
|
2022-05-22 01:27:29 +02:00
|
|
|
ifz mov r0, panic_string
|
2022-03-19 05:59:51 +01:00
|
|
|
call debug_print
|
2022-06-24 00:42:56 +02:00
|
|
|
call print_string_to_monitor
|
2022-10-28 04:10:03 +02:00
|
|
|
pop r0
|
|
|
|
brk
|
2022-06-24 00:42:56 +02:00
|
|
|
rjmp 0
|
2022-03-19 05:59:51 +01:00
|
|
|
|
2022-06-24 00:42:56 +02:00
|
|
|
panic_string: data.str "Unspecified panic occurred!" data.8 10 data.8 0
|