diff --git a/debug.asm b/debug.asm index a996647..b361f00 100644 --- a/debug.asm +++ b/debug.asm @@ -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 - ret \ No newline at end of file + pop r0 + ret diff --git a/panic.asm b/panic.asm index 6b4452a..cee03cf 100644 --- a/panic.asm +++ b/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