From 46abf8d893ad55f5e20993456360d080184bf084 Mon Sep 17 00:00:00 2001 From: Gelthor Date: Sun, 6 Sep 2026 11:02:27 +0100 Subject: [PATCH] Add globals and error codes Added support for global variables. This requires including `start.asm` as the first code. This includes a `jmp` to 0x100 for user code, and a magic number that modules can check to verify th the user has correctly reserved the space. The magic number is 0xb301534c: * This has the high bit set so is not a valid instruction * On builds that ignore the high bit this decodes to `nor zr, zr, 0x534c` a no-op. * The immediate is "SL" for standardl ibrary. Due to a bug start pads with U... 0, instead of @addr. `start.asm` also initialises `sp` so it start just below the 64KiB LUT memory alocation. Added some error codes for the upcoming graphics module. --- CONTRIBUTING.md | 13 +- README.md | 9 +- src/errno.asm | 3 + src/globals.asm | 24 +- src/graphics_32.asm | 672 ++++++++++++++++++++++++++++++++++++++++++++ src/start.asm | 23 +- 6 files changed, 730 insertions(+), 14 deletions(-) create mode 100644 src/graphics_32.asm diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed897a3..f316bb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,10 +16,21 @@ All functions in the standard library should follow the following outline: ; Arguments: ; Result: ; Clobbers: +; Globals: