summaryrefslogtreecommitdiff
path: root/programs/sub-suite/declare.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite/declare.s')
-rw-r--r--programs/sub-suite/declare.s88
1 files changed, 67 insertions, 21 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 183d09d..6a8c90f 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -68,6 +68,19 @@
op .byte ; Base value used to get the actual opcode.
.endstruct
+; Free memory block struct, used by malloc.
+.struct fblk
+ size .qword ; Size of free memory block.
+ next .qword ; Pointer to next free block.
+ prev .qword ; Pointer to previous free block.
+.endstruct
+
+; Used memory block struct, used by malloc.
+.struct ublk
+ size .qword ; Size of used memory block.
+ start .qword ; Starting address of memory block.
+.endstruct
+
; Enums.
@@ -81,8 +94,17 @@ step = $110 ; Enables clock stepping, when set.
maxrow = 23 ; Screen's row count.
maxcol = 79 ; Screen's column count.
-MAX_SYM = $800 ; Max symbol size.
-OPNUM = 74 ; Instruction count.
+; Table sizes.
+SCRSIZE = $2000 ; Screen buffer size, in bytes.
+CMDSIZE = $400 ; Command buffer size, in bytes.
+LWSIZE = $1000 ; Linewrap table size, in bytes.
+
+; Magic number used by findramend.
+MAGIC = $AA
+
+; Heap related values.
+HEAPORG = $30000 ; Starting point of the heap.
+
; Directives.
DIR_ORG = 0 ; Origin.
@@ -164,23 +186,10 @@ IMPL = 1 << 10 ; Implied.
INDX2 = 1 << 11 ; Special case of INDX that uses the indirect table.
ZM2 = 1 << 12 ; Special case of Zero Matrix used by JMP, and JSR.
-
+OPNUM = 74 ; Instruction count.
; RAM declarations.
-; Linewrap table.
-.org $30000
-bitabl:
- .res $1000
-
-; Screen buffer.
-buffer:
- .res $2000
-
-; Command buffer.
-cmd_buf:
- .res $400
-
; Screen variables.
.org 0
scr_row:
@@ -238,10 +247,7 @@ ptr3:
.res 8
-; Token table.
.org $20000
-tokline:
- .res $400
; Program Counter.
prg_cnt:
@@ -327,14 +333,54 @@ lex_type:
lexeme:
.res $100
+; Size of the heap.
+heapsize:
+ .res 8
+
+; Start of the heap.
+heapstr:
+ .res 8
+
+; End of the heap.
+heapend:
+ .res 8
+
+; Current top of the heap.
+heapptr:
+ .res 8
+
+; First heap entry.
+heapf:
+ .res 8
+
+; Last heap entry.
+heapl:
+ .res 8
+
+; Linewrap table.
+bitabl:
+ .res 8
+
+; Screen buffer.
+buffer:
+ .res 8
+
+; Command buffer.
+cmd_buf:
+ .res 8
+
+; Token table.
+tokline:
+ .res 8
+
; Symbol table.
symbol:
- .res $8000
+ .res 8
; Fixup table.
; Fixups are unresolved symbols.
fixup:
- .res $2000
+ .res 8
; ROM data declarations.