forked from TCShenanigans/symphony_stdlib
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.
This commit is contained in:
+19
-4
@@ -1,4 +1,19 @@
|
||||
@0 ; Reserve space for globals
|
||||
|
||||
jmp 0x100 ; jump over them
|
||||
@0x100 ; start of user code
|
||||
;@0 ; Reserve space for globals
|
||||
|
||||
; First initialise the stack pointer
|
||||
nor sp, zr, 0xffff
|
||||
; Jump over the globals to user code
|
||||
jmp 0x100
|
||||
|
||||
U32 0 ; 4 bytes
|
||||
|
||||
; MAGIC_VALUE
|
||||
;@0x0c
|
||||
U32 0xb301534c
|
||||
|
||||
; Pad with zeroes since the @addr feature is currently broken.
|
||||
; * https://discord.com/channels/828292123936948244/1545010596246847568
|
||||
;
|
||||
U1920 0 ; 240 bytes
|
||||
|
||||
;@0x100 ; start of user code
|
||||
Reference in New Issue
Block a user