Added initial draft of globals and errno

This commit is contained in:
2026-09-04 16:07:24 +01:00
parent 9dcc182954
commit 4d752ef67c
3 changed files with 46 additions and 0 deletions
Executable
+24
View File
@@ -0,0 +1,24 @@
; Error numbers should be 16 bit ODD numbers, so they can be loaded as immediates
; and can be checked with:
;
; qcall falible_function
; jne falible_ok ; Jump no error
; ; handle error
; falible_ok:
; ; Happy path
; ; ...
; OR
; qcall falible_function
; je handle_error ; Jump if error
; ; Happy path
; ; ...
; handle_error:
; ; handle error
pub const OK = 0x0000
pub const SCREEN_INVALID_MODE = 0x0001
pub const SCREEN_INVALID_WIDTH = 0x0003
pub const SCREEN_FB_TOO_SMALL = 0x0005
; Extended error codes, these would require loading a 32 bit value.
pub const EXT_OK = 0x00000000