From 8a3b12774fed78224168ffe477382bcb72d00277 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Sat, 21 Sep 2024 13:45:15 -0400 Subject: [PATCH] small optimization to error printer saves us 5 bytes of code (15 overall) --- include/errors.inc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/errors.inc b/include/errors.inc index a07630e..31f723a 100755 --- a/include/errors.inc +++ b/include/errors.inc @@ -94,19 +94,18 @@ error: mov dx, STEVIA_DEBUG_OK cmp ax, dx jge error.debug_err + mov dh, 0x4F ; color 0x4F is white text/red background + jmp error.print +.debug_err: + mov dh, 0x5F ; debug case is white text/purple background ; the characters are two bytes in the order of 0xb8000: byte c, byte attribute ; since x86 is le, we store the attribute in the MSB of dx - mov dh, 0x4F ; color 0x4F is white text/red background +.print: mov dl, al mov word [fs:0x0000], dx jmp error.stop -.debug_err: - mov dh, 0x5F ; debug case is white text/purple background - mov dl, al - mov word [fs:0x0000], dx - .stop: hlt jmp short error.stop \ No newline at end of file