1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-10-06 01:55:47 +00:00

Build jit16 for real

This commit is contained in:
David Schmenk 2018-04-11 10:06:57 -07:00
parent 177c951a2d
commit 3e4d0bcedf
4 changed files with 26 additions and 22 deletions

View File

@ -37,7 +37,7 @@ def defcpy(dst, defptr)#0
*$0042 = dst
call($C311, 0, 0, 0, $04) // CALL XMOVE with carry clear (AUX->MAIN) and ints disabled
end
include "libsrc/jitcore.pla"
include "libsrc/jit16core.pla"
//
// Install JIT compiler
//

View File

@ -423,7 +423,7 @@ def compiler(defptr)#0
codeptr=>3 = $C3+(TOS<<8) // CMP TOS,S
if opcode == $40
//puts("ISEQ")
codeptr=5 = $01D0 // BNE +1
codeptr=>5 = $01D0 // BNE +1
else
//puts("ISNE")
codeptr=>5 = $01F0 // BEQ +1
@ -1233,9 +1233,9 @@ def compiler(defptr)#0
codeptr=>2 = $B5+(J<<8) // LDA dp,X
codeptr->4 = $29 // AND #$00FF
codeptr=>5 = $00FF
codeptr=>7 = $180A // ASL; CLC
codeptr=>9 = $E665 // ADC TMP
codeptr = codeptr + 11
codeptr->7 = $0A // ASL
codeptr=>8 = $E665 // ADC TMP
codeptr = codeptr + 10
A_IS_TOS = TRUE // PHA
break
is $BA // IDXLW
@ -1250,9 +1250,11 @@ def compiler(defptr)#0
codeptr = codeptr + 2
X_IS_IFP = TRUE
fin
codeptr=>0 = $180A // ASL; CLC
codeptr=>2 = $75+(J<<8) // ADC dp,X
codeptr = codeptr + 4
codeptr->0 = $18 // CLC
codeptr=>1 = $75+(J<<8) // ADC dp,X
codeptr->3 = $18 // CLC
codeptr=>4 = $75+(J<<8) // ADC dp,X
codeptr = codeptr + 6
A_IS_TOS = TRUE // PHA
break
is $BC // IDXAB
@ -1269,9 +1271,9 @@ def compiler(defptr)#0
codeptr=>7 = $20C2 // REP #$20 -> 16 BIT ACCUM/MEM
codeptr->9 = $29 // AND #$00FF
codeptr=>10 = $00FF
codeptr=>12 = $180A // ASL; CLC
codeptr=>14 = $E665 // ADC TMP
codeptr = codeptr + 16
codeptr->12 = $0A // ASL
codeptr=>13 = $E665 // ADC TMP
codeptr = codeptr + 15
A_IS_TOS = TRUE // PHA
break
is $BE // IDXAW
@ -1281,10 +1283,11 @@ def compiler(defptr)#0
if not A_IS_TOS
^codeptr = $68; codeptr++ // PLA
fin
codeptr=>0 = $180A // ASL; CLC
codeptr->2 = $6D // ADC abs
codeptr=>3 = dest
codeptr = codeptr + 5
codeptr=>0 = $6D18 // CLC; ADC abs
codeptr=>2 = dest
codeptr=>4 = $6D18 // CLC; ADC abs
codeptr=>6 = dest
codeptr = codeptr + 8
A_IS_TOS = TRUE // PHA
break
is $FE // NOPed out earlier by SELect

View File

@ -232,7 +232,7 @@ hello: samplesrc/hello.pla $(PLVM) $(PLASM)
acme --setpc 4094 -o $(HELLO) samplesrc/hello.a
./$(PLVM) HELLO
$(ROD): samplesrc/rod.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMO < samplesrc/rod.pla > samplesrc/rod.a
./$(PLASM) -AMOW < samplesrc/rod.pla > samplesrc/rod.a
acme --setpc 4094 -o $(ROD) samplesrc/rod.a
$(SIEVE): samplesrc/sieve.pla $(PLVM02) $(PLASM)
@ -364,19 +364,19 @@ $(MON): samplesrc/mon.pla $(PLVM02) $(PLASM)
acme --setpc 4094 -o $(MON) samplesrc/mon.a
$(SOS): libsrc/apple/sos.pla $(PLVM03) $(PLASM)
./$(PLASM) -AMO < libsrc/apple/sos.pla > libsrc/apple/sos.a
./$(PLASM) -AMOW < libsrc/apple/sos.pla > libsrc/apple/sos.a
acme --setpc 4094 -o $(SOS) libsrc/apple/sos.a
$(JIT): libsrc/apple/jit.pla libsrc/jitcore.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMO < libsrc/apple/jit.pla > libsrc/apple/jit.a
./$(PLASM) -AMOW < libsrc/apple/jit.pla > libsrc/apple/jit.a
acme --setpc 4094 -o $(JIT) libsrc/apple/jit.a
$(JIT16): libsrc/apple/jit16.pla libsrc/jit16core.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMO < libsrc/apple/jit16.pla > libsrc/apple/jit16.a
./$(PLASM) -AMOW < libsrc/apple/jit16.pla > libsrc/apple/jit16.a
acme --setpc 4094 -o $(JIT16) libsrc/apple/jit16.a
$(JITUNE): libsrc/apple/jitune.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMO < libsrc/apple/jitune.pla > libsrc/apple/jitune.a
./$(PLASM) -AMOW < libsrc/apple/jitune.pla > libsrc/apple/jitune.a
acme --setpc 4094 -o $(JITUNE) libsrc/apple/jitune.a

View File

@ -3,7 +3,7 @@ include "inc/conio.plh"
//
// Rod's Colors
//
def rod
def rod#0
byte i, j, k, w, fmi, fmk, color
while TRUE
@ -24,7 +24,8 @@ def rod
conio:grplot(i, fmk)
conio:grplot(fmk, i)
if conio:keypressed()
return getc
getc
return
fin
next
next