remove eval stack references from p8 code

This commit is contained in:
Irmen de Jong 2023-07-15 11:47:31 +02:00
parent 708e296774
commit 3933bf5c1a
5 changed files with 3 additions and 26 deletions

View File

@ -446,10 +446,6 @@ _irq_handler_init
sta IRQ_SCRATCH_ZPWORD2 sta IRQ_SCRATCH_ZPWORD2
lda P8ZP_SCRATCH_W2+1 lda P8ZP_SCRATCH_W2+1
sta IRQ_SCRATCH_ZPWORD2+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 cld
rts rts
@ -774,7 +770,7 @@ cx16 {
; the sixteen virtual 16-bit registers that the CX16 has defined in the zeropage ; 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 ; 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) ; (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 r0 = $1be0
&uword r1 = $1be2 &uword r1 = $1be2
&uword r2 = $1be4 &uword r2 = $1be4

View File

@ -413,10 +413,6 @@ _irq_handler_init
sta IRQ_SCRATCH_ZPWORD2 sta IRQ_SCRATCH_ZPWORD2
lda P8ZP_SCRATCH_W2+1 lda P8ZP_SCRATCH_W2+1
sta IRQ_SCRATCH_ZPWORD2+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 cld
rts rts

View File

@ -855,10 +855,6 @@ _irq_handler_init
sta IRQ_SCRATCH_ZPWORD2 sta IRQ_SCRATCH_ZPWORD2
lda P8ZP_SCRATCH_W2+1 lda P8ZP_SCRATCH_W2+1
sta IRQ_SCRATCH_ZPWORD2+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 cld
rts rts

View File

@ -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 %import textio
@ -7,7 +7,6 @@ test_stack {
asmsub test() { asmsub test() {
%asm {{ %asm {{
stx _saveX
lda #13 lda #13
jsr txt.chrout jsr txt.chrout
lda #'-' lda #'-'
@ -17,14 +16,6 @@ test_stack {
bne - bne -
lda #13 lda #13
jsr txt.chrout jsr txt.chrout
lda #'x'
jsr txt.chrout
lda #'='
jsr txt.chrout
lda _saveX
jsr txt.print_ub
lda #' '
jsr txt.chrout
lda #'s' lda #'s'
jsr txt.chrout jsr txt.chrout
lda #'p' lda #'p'
@ -43,9 +34,7 @@ test_stack {
bne - bne -
lda #13 lda #13
jsr txt.chrout jsr txt.chrout
ldx _saveX
rts rts
_saveX .byte 0
}} }}
} }
} }

View File

@ -1,12 +1,12 @@
TODO TODO
==== ====
- (branch): remove all evalstack references from p8 code files
- (branch): remove all evalstack references from asm code files - (branch): remove all evalstack references from asm code files
- (branch): remove ExpressionsAsmGen.kt altogether - (branch): remove ExpressionsAsmGen.kt altogether
- (branch): clean up all X register special handling - (branch): clean up all X register special handling
- (branch): fix optimizeCmpSequence in AsmOptimizer - (branch): fix optimizeCmpSequence in AsmOptimizer
- (branch): fix inplaceModification TODO in AugmentableAssignmentAsmGen - (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 - (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. - IR: instructions that do type conversion (SZ etc, CONCAT, SGN) should put the result in a DIFFERENT register.