From fee7b1fa64131bfda7e2cf7b43b69d7ab98e0274 Mon Sep 17 00:00:00 2001 From: ry755 Date: Fri, 11 Feb 2022 19:41:58 -0800 Subject: [PATCH] fox32rom: Add a small debug routine for printing to the terminal --- debug.asm | 17 +++++++++++++++++ main.asm | 1 + 2 files changed, 18 insertions(+) create mode 100644 debug.asm diff --git a/debug.asm b/debug.asm new file mode 100644 index 0000000..a996647 --- /dev/null +++ b/debug.asm @@ -0,0 +1,17 @@ +; debug routines + +; print a string to the terminal +; inputs: +; r0: pointer to null-terminated string +; outputs: +; none +debug_print: + push r1 +debug_print_loop: + mov r1, 0x00000000 + out r1, [r0] + inc r0 + cmp.8 [r0], 0x00 + ifnz jmp debug_print_loop + pop r1 + ret \ No newline at end of file diff --git a/main.asm b/main.asm index 706c425..b4cf4ae 100644 --- a/main.asm +++ b/main.asm @@ -164,6 +164,7 @@ mount_boot_disk: ; code #include "boot.asm" #include "background.asm" + #include "debug.asm" #include "overlay.asm" #include "memory.asm" #include "menu.asm"