diff --git a/compiler/res/prog8lib/c128/syslib.p8 b/compiler/res/prog8lib/c128/syslib.p8 index 3ae8a4db8..fcada06c7 100644 --- a/compiler/res/prog8lib/c128/syslib.p8 +++ b/compiler/res/prog8lib/c128/syslib.p8 @@ -446,10 +446,6 @@ _irq_handler_init sta IRQ_SCRATCH_ZPWORD2 lda P8ZP_SCRATCH_W2+1 sta IRQ_SCRATCH_ZPWORD2+1 - ; Set X to the bottom 32 bytes of the evaluation stack, to HOPEFULLY not clobber it. - ; This leaves 128-32=96 stack entries for the main program, and 32 stack entries for the IRQ handler. - ; We assume IRQ handlers don't contain complex expressions taking up more than that. - ldx #32 cld rts @@ -774,7 +770,7 @@ cx16 { ; the sixteen virtual 16-bit registers that the CX16 has defined in the zeropage ; they are simulated on the C128 as well but their location in memory is different ; (because there's no room for them in the zeropage) - ; $1300-$1bff is unused RAM on C128. We'll use $1a00-$1bff as the lo/hi evalstack. + ; $1300-$1bff is unused RAM on C128. &uword r0 = $1be0 &uword r1 = $1be2 &uword r2 = $1be4 diff --git a/compiler/res/prog8lib/c64/syslib.p8 b/compiler/res/prog8lib/c64/syslib.p8 index bf33227ef..1280a1f7c 100644 --- a/compiler/res/prog8lib/c64/syslib.p8 +++ b/compiler/res/prog8lib/c64/syslib.p8 @@ -413,10 +413,6 @@ _irq_handler_init sta IRQ_SCRATCH_ZPWORD2 lda P8ZP_SCRATCH_W2+1 sta IRQ_SCRATCH_ZPWORD2+1 - ; Set X to the bottom 32 bytes of the evaluation stack, to HOPEFULLY not clobber it. - ; This leaves 128-32=96 stack entries for the main program, and 32 stack entries for the IRQ handler. - ; We assume IRQ handlers don't contain complex expressions taking up more than that. - ldx #32 cld rts diff --git a/compiler/res/prog8lib/cx16/syslib.p8 b/compiler/res/prog8lib/cx16/syslib.p8 index fd6873c49..59608c45f 100644 --- a/compiler/res/prog8lib/cx16/syslib.p8 +++ b/compiler/res/prog8lib/cx16/syslib.p8 @@ -855,10 +855,6 @@ _irq_handler_init sta IRQ_SCRATCH_ZPWORD2 lda P8ZP_SCRATCH_W2+1 sta IRQ_SCRATCH_ZPWORD2+1 - ; Set X to the bottom 32 bytes of the evaluation stack, to HOPEFULLY not clobber it. - ; This leaves 128-32=96 stack entries for the main program, and 32 stack entries for the IRQ handler. - ; We assume IRQ handlers don't contain complex expressions taking up more than that. - ldx #32 cld rts diff --git a/compiler/res/prog8lib/test_stack.p8 b/compiler/res/prog8lib/test_stack.p8 index 11f18d0ef..6a7fa33bf 100644 --- a/compiler/res/prog8lib/test_stack.p8 +++ b/compiler/res/prog8lib/test_stack.p8 @@ -1,4 +1,4 @@ -; utility debug code to print the X (evalstack) and SP (cpu stack) registers. +; utility debug code to print the SP (cpu stack pointer) register. %import textio @@ -7,7 +7,6 @@ test_stack { asmsub test() { %asm {{ - stx _saveX lda #13 jsr txt.chrout lda #'-' @@ -17,14 +16,6 @@ test_stack { bne - lda #13 jsr txt.chrout - lda #'x' - jsr txt.chrout - lda #'=' - jsr txt.chrout - lda _saveX - jsr txt.print_ub - lda #' ' - jsr txt.chrout lda #'s' jsr txt.chrout lda #'p' @@ -43,9 +34,7 @@ test_stack { bne - lda #13 jsr txt.chrout - ldx _saveX rts -_saveX .byte 0 }} } } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 0dde233cf..7ae12265d 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,12 +1,12 @@ TODO ==== -- (branch): remove all evalstack references from p8 code files - (branch): remove all evalstack references from asm code files - (branch): remove ExpressionsAsmGen.kt altogether - (branch): clean up all X register special handling - (branch): fix optimizeCmpSequence in AsmOptimizer - (branch): fix inplaceModification TODO in AugmentableAssignmentAsmGen +- (branch): fix up cx16/keyboardhandler.p8 X register shenanigans - (branch): clean up docs about eval stack and X register - IR: instructions that do type conversion (SZ etc, CONCAT, SGN) should put the result in a DIFFERENT register.