summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
Diffstat (limited to 'programs')
-rw-r--r--programs/sub-suite/declare.s3
-rw-r--r--programs/sub-suite/subeditor.s12
2 files changed, 12 insertions, 3 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 6a8c90f..7b419e2 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -102,6 +102,9 @@ LWSIZE = $1000 ; Linewrap table size, in bytes.
; Magic number used by findramend.
MAGIC = $AA
+; Size of the Stack.
+STKSIZE = $30000
+
; Heap related values.
HEAPORG = $30000 ; Starting point of the heap.
diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s
index d98d068..addd64a 100644
--- a/programs/sub-suite/subeditor.s
+++ b/programs/sub-suite/subeditor.s
@@ -6,11 +6,19 @@
.org $8000
reset:
cps ; Reset the processor status register.
- ldx.w #$FFFF ; Reset the stack pointer.
+ ldx.d #$2FFFF ; Reset the stack pointer.
txs ;
ldy #0 ; Reset Y.
tyx ; Reset X.
jsr init_heap ; Initialize the heap.
+ inc step ;
+ tax ; Set the stack pointer to the end of RAM.
+ txs ;
+ sec ; Prepare for a non borrowing subtract.
+ sbc.d #STKSIZE ; Subtract the stack size, from the end of RAM.
+ sta.q heapend ; Save the end of the heap.
+ and #0 ; Reset A.
+ tax ; Reset X.
jsr init_tables ; Initialize the main tables.
; jsr test_free ;
jsr clr_scr ; Clear the screen.
@@ -27,8 +35,6 @@ init_heap:
jsr findramend ; Find the end of the heap.
plb.q ; Restore the value in B.
plx.q ; Restore the value in X.
- sta.q heapend ; Save the end of the heap.
- and #0 ; Reset A.
rts ; End of init_heap.