1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-23 02:29:02 +00:00

Improve LLA opts a little

This commit is contained in:
David Schmenk 2018-03-31 15:13:13 -07:00
parent 53a992debb
commit 630ccd88fa
2 changed files with 46 additions and 24 deletions

View File

@ -360,19 +360,30 @@ def compiler(defptr)#0
j = ^(bytecode+i)
//puts("LLA "); puti(^(bytecode+i))
if A_IS_TOSL & TOS_DIRTY
*codeptr = $D095+(VX<<8) // STA ESTKL,X
*codeptr = $D095+(VX<<8) // STA ESTKL,X
codeptr = codeptr + 2
fin
VX-- // DEX
codeptr=>0 = $A9+(j<<8) // LDA #imm
codeptr->2 = $18 // CLC
codeptr=>3 = $E065 // ADC IFPL
codeptr=>5 = $D095+(VX<<8) // STA ESTKL,X
codeptr=>7 = $00A9 // LDA #$00
codeptr=>9 = $E165 // ADC IFPH
codeptr=>11 = $C095+(VX<<8) // STA ESTKH,X
codeptr = codeptr + 13
A_IS_TOSL = FALSE
VX-- // DEX
if VY == j
^codeptr = $98; codeptr++ // TYA -> LDA #imm
else
*codeptr = $A9+(j<<8) // LDA #imm
codeptr = codeptr + 2
fin
codeptr->0 = $18 // CLC
codeptr=>1 = $E065 // ADC IFPL
codeptr=>3 = $D095+(VX<<8) // STA ESTKL,X
if VY == 0
codeptr->5 = $98 // TYA -> LDA #00
codeptr = codeptr + 6
else
codeptr=>5 = $00A9 // LDA #$00
codeptr = codeptr + 7
fin
codeptr=>0 = $E165 // ADC IFPH
codeptr=>2 = $C095+(VX<<8) // STA ESTKH,X
codeptr = codeptr + 4
A_IS_TOSL = FALSE
break
is $2A // CB
i++

View File

@ -344,19 +344,30 @@ def compiler(defptr)#0
j = ^(bytecode+i)
//puts("LLA "); puti(^(bytecode+i))
if A_IS_TOSL & TOS_DIRTY
*codeptr = $D095+(VX<<8) // STA ESTKL,X
*codeptr = $D095+(VX<<8) // STA ESTKL,X
codeptr = codeptr + 2
fin
VX-- // DEX
codeptr=>0 = $A9+(j<<8) // LDA #imm
codeptr->2 = $18 // CLC
codeptr=>3 = $E065 // ADC IFPL
codeptr=>5 = $D095+(VX<<8) // STA ESTKL,X
codeptr=>7 = $00A9 // LDA #$00
codeptr=>9 = $E165 // ADC IFPH
codeptr=>11 = $C095+(VX<<8) // STA ESTKH,X
codeptr = codeptr + 13
A_IS_TOSL = FALSE
VX-- // DEX
if VY == j
^codeptr = $98; codeptr++ // TYA -> LDA #imm
else
*codeptr = $A9+(j<<8) // LDA #imm
codeptr = codeptr + 2
fin
codeptr->0 = $18 // CLC
codeptr=>1 = $E065 // ADC IFPL
codeptr=>3 = $D095+(VX<<8) // STA ESTKL,X
if VY == 0
codeptr->5 = $98 // TYA -> LDA #00
codeptr = codeptr + 6
else
codeptr=>5 = $00A9 // LDA #$00
codeptr = codeptr + 7
fin
codeptr=>0 = $E165 // ADC IFPH
codeptr=>2 = $C095+(VX<<8) // STA ESTKH,X
codeptr = codeptr + 4
A_IS_TOSL = FALSE
break
is $2A // CB
is $5E // CFFB
@ -1590,10 +1601,10 @@ end
// Install JIT compiler
//
if *jitcomp
puts("JIT compiler already installed!\n")
//puts("JIT compiler already installed!\n")
return 0
fin
puts("Installing JIT compiler\n")
puts("JITC installed\n")
*jitcomp = @compiler
return modkeep
done