Optimize for bytecode interp in AUX MEM

This commit is contained in:
David Schmenk 2014-05-23 13:37:28 -07:00
parent 8309669ad8
commit c105d61ca9
3 changed files with 54 additions and 18 deletions

View File

@ -110,10 +110,6 @@ LCRWEN = $C083
LCBNK2 = $00
LCBNK1 = $08
!SOURCE "plvm02zp.inc"
;*
;* ASM VARIABLES
;*
ESP = $E8
end
;
; CALL 6502 ROUTINE

View File

@ -37,7 +37,6 @@ ALTRDON = $C003
ALTWROFF= $C004
ALTWRON = $C005
!SOURCE "plvm02zp.inc"
ESP = DST+2
;**********************************************************
;*
;* INTERPRETER INSTRUCTION POINTER INCREMENT MACRO
@ -185,6 +184,8 @@ PAGE3 = *
JMP IINTRP
BIT LCRDEN+LCBNK2 ; $03DC - INDIRECT INTERPX ENTRY
JMP IINTRPX
TMRVEC !WORD TMRRTS
TMRRTS RTS
}
VMCORE = *
!PSEUDOPC $D000 {
@ -310,6 +311,8 @@ IINTRPX BIT LCRWEN+LCBNK2 ; WRITE ENABLE LANGUAGE CARD
LDA (TMP),Y
STA IPL
DEY
SEI
STA ALTRDON
BEQ FETCHOPX
;*
;* INTERP BYTECODE IN AUX MEM
@ -319,11 +322,17 @@ NEXTOPHX INC IPH
DROPX INX
NEXTOPX INY
BEQ NEXTOPHX
FETCHOPX SEI
STA ALTRDON
LDA (IP),Y
; INC TICTOC
; BEQ TIMERX
FETCHOPX LDA (IP),Y
STA *+4
JMP (OPXTBL)
JMP (OPXTBL) ; USE AUX OPCODES
TIMERX STA ALTRDOFF
CLI
JSR JMPTMR
SEI
STA ALTRDON
JMP FETCHOPX
;*
;* INTERP BYTECODE IN MAIN MEM
;*
@ -332,10 +341,18 @@ NEXTOPH INC IPH
DROP INX
NEXTOP INY
BEQ NEXTOPH
; INC TICTOC
; BEQ TIMER
FETCHOP LDA (IP),Y
ORA #$80 ; SELECT OP OPCODES
ORA #$80 ; USE MAIN OPCODES
STA *+4
JMP (OPTBL)
TIMER JSR JMPTMR
JMP FETCHOP
;*
;* INDIRECT JUMP TO (TMRVEC)
;*
JMPTMR JMP (TMRVEC)
;*
;* INDIRECT JUMP TO (TMP)
;*
@ -980,24 +997,25 @@ LW LDA ESTKL,X
LDY IPY
JMP NEXTOP
;
LBX STA ALTRDOFF
LDA ESTKL,X
LBX LDA ESTKL,X
STA TMPL
LDA ESTKH,X
STA TMPH
STY IPY
STA ALTRDOFF
LDY #$00
LDA (TMP),Y
STA ESTKL,X
STY ESTKH,X
LDY IPY
STA ALTRDON
JMP NEXTOPX
LWX STA ALTRDOFF
LDA ESTKL,X
LWX LDA ESTKL,X
STA TMPL
LDA ESTKH,X
STA TMPH
STY IPY
STA ALTRDOFF
LDY #$00
LDA (TMP),Y
STA ESTKL,X
@ -1005,6 +1023,7 @@ LWX STA ALTRDOFF
LDA (TMP),Y
STA ESTKH,X
LDY IPY
STA ALTRDON
JMP NEXTOPX
;*
;* LOAD ADDRESS OF LOCAL FRAME OFFSET
@ -1067,6 +1086,7 @@ LLBX +INC_IP
STA ESTKL,X
LDA #$00
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOPX
LLWX +INC_IP
@ -1080,6 +1100,7 @@ LLWX +INC_IP
INY
LDA (IFP),Y
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOPX
;*
@ -1129,6 +1150,7 @@ LABX +INC_IP
DEX
STA ESTKL,X
STY ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOPX
LAWX +INC_IP
@ -1146,6 +1168,7 @@ LAWX +INC_IP
INY
LDA (TMP),Y
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOPX
;*
@ -1188,6 +1211,7 @@ SBX LDA ESTKL+1,X
STA ALTRDOFF
LDY #$00
STA (TMP),Y
STA ALTRDON
INX
INX
LDY IPY
@ -1204,6 +1228,7 @@ SWX LDA ESTKL+1,X
INY
LDA ESTKH,X
STA (TMP),Y
STA ALTRDON
INX
INX
LDY IPY
@ -1240,6 +1265,7 @@ SLBX +INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
STA ALTRDON
INX
LDY IPY
JMP NEXTOPX
@ -1253,6 +1279,7 @@ SLWX +INC_IP
INY
LDA ESTKH,X
STA (IFP),Y
STA ALTRDON
INX
LDY IPY
JMP NEXTOPX
@ -1286,6 +1313,7 @@ DLBX +INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
STA ALTRDON
LDY IPY
JMP NEXTOPX
DLWX +INC_IP
@ -1298,6 +1326,7 @@ DLWX +INC_IP
INY
LDA ESTKH,X
STA (IFP),Y
STA ALTRDON
LDY IPY
JMP NEXTOPX
;*
@ -1344,6 +1373,7 @@ SABX +INC_IP
STA ALTRDOFF
LDY #$00
STA (TMP),Y
STA ALTRDON
INX
LDY IPY
JMP NEXTOPX
@ -1361,6 +1391,7 @@ SAWX +INC_IP
INY
LDA ESTKH,X
STA (TMP),Y
STA ALTRDON
INX
LDY IPY
JMP NEXTOPX
@ -1406,6 +1437,7 @@ DABX +INC_IP
LDY #$00
LDA ESTKL,X
STA (TMP),Y
STA ALTRDON
LDY IPY
JMP NEXTOPX
DAWX +INC_IP
@ -1422,6 +1454,7 @@ DAWX +INC_IP
INY
LDA ESTKH,X
STA (TMP),Y
STA ALTRDON
LDY IPY
JMP NEXTOPX
;*
@ -1791,6 +1824,8 @@ CALLX +INC_IP
STA ALTRDOFF
CLI
JSR JMPTMP
SEI
STA ALTRDON
PLA
TAY
PLA
@ -1839,6 +1874,8 @@ ICALX LDA ESTKL,X
STA ALTRDOFF
CLI
JSR JMPTMP
SEI
STA ALTRDON
PLA
TAY
PLA
@ -1897,6 +1934,7 @@ ENTERX +INC_IP
LDA (IP),Y
STA NPARMS
STY IPY
STA ALTRDOFF
LDA IFPL
PHA
SEC
@ -1906,7 +1944,6 @@ ENTERX +INC_IP
PHA
SBC #$00
STA IFPH
STA ALTRDOFF
LDY #$01
PLA
STA (IFP),Y
@ -1927,7 +1964,8 @@ ENTERX4 LDA ESTKH,X
INX
DEC TMPL
BNE ENTERX4
ENTERX5 LDY IPY
ENTERX5 STA ALTRDON
LDY IPY
JMP NEXTOPX
;*
;* LEAVE FUNCTION
@ -1943,6 +1981,7 @@ LEAVE LDY #$01
RET RTS
;
LEAVEX STA ALTRDOFF
CLI
LDY #$01
LDA (IFP),Y
DEY
@ -1951,7 +1990,6 @@ LEAVEX STA ALTRDOFF
STA IFPL
PLA
STA IFPH
CLI
RTS
RETX STA ALTRDOFF
CLI

View File

@ -22,6 +22,8 @@ TMPX = TMP+2
NPARMS = TMPL
FRMSZ = TMPH
DVSIGN = TMPX
ESP = TMPX
TICTOC = TMP+3
SRC = $06
SRCL = SRC
SRCH = SRC+1