Invoke the monitor on panic
This commit is contained in:
parent
ad0571d420
commit
ac337bc340
|
@ -6,6 +6,7 @@
|
|||
; outputs:
|
||||
; none
|
||||
debug_print:
|
||||
push r0
|
||||
push r1
|
||||
debug_print_loop:
|
||||
mov r1, 0x00000000
|
||||
|
@ -14,4 +15,5 @@ debug_print_loop:
|
|||
cmp.8 [r0], 0x00
|
||||
ifnz jmp debug_print_loop
|
||||
pop r1
|
||||
pop r0
|
||||
ret
|
10
panic.asm
10
panic.asm
|
@ -1,6 +1,6 @@
|
|||
; panic routines
|
||||
|
||||
; panic and hang
|
||||
; panic invoke the monitor
|
||||
; inputs:
|
||||
; r0: pointer to null-terminated string, or zero for none
|
||||
; outputs:
|
||||
|
@ -10,8 +10,8 @@ panic:
|
|||
cmp r0, 0
|
||||
ifz mov r0, panic_string
|
||||
call debug_print
|
||||
panic_loop:
|
||||
jmp panic_loop
|
||||
halt
|
||||
call print_string_to_monitor
|
||||
call invoke_monitor
|
||||
rjmp 0
|
||||
|
||||
panic_string: data.str "Panic occurred!" data.8 10 data.8 0
|
||||
panic_string: data.str "Unspecified panic occurred!" data.8 10 data.8 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user