1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-11-04 11:07:00 +00:00

Faster ADDx ops

This commit is contained in:
David Schmenk 2018-03-14 17:22:12 -07:00
parent 852b5b7268
commit b145f82a9d
3 changed files with 505 additions and 237 deletions

View File

@ -501,7 +501,7 @@ LLA INY ;+INC_IP
;*
;* LOAD VALUE FROM LOCAL FRAME OFFSET
;*
LLB INY ;+INC_IP
_LLB INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
@ -511,8 +511,8 @@ LLB INY ;+INC_IP
LDA #$00
STA ESTKH,X
LDY IPY
JMP NEXTOP
LLW INY ;+INC_IP
RTS
_LLW INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
@ -523,41 +523,29 @@ LLW INY ;+INC_IP
LDA (IFP),Y
STA ESTKH,X
LDY IPY
RTS
LLB JSR _LLB
JMP NEXTOP
LLW JSR _LLW
JMP NEXTOP
;*
;* ADD VALUE FROM LOCAL FRAME OFFSET
;*
ADDLB LDA #$60 ; RTS
STA NEXTOP
JSR LLB
LDA #$C8 ; INY
STA NEXTOP
ADDLB JSR _LLB
JMP ADD
ADDLW LDA #$60 ; RTS
STA NEXTOP
JSR LLW
LDA #$C8 ; INY
STA NEXTOP
ADDLW JSR _LLW
JMP ADD
;*
;* INDEX VALUE FROM LOCAL FRAME OFFSET
;*
IDXLB LDA #$60 ; RTS
STA NEXTOP
JSR LLB
LDA #$C8 ; INY
STA NEXTOP
IDXLB JSR _LLB
JMP IDXW
IDXLW LDA #$60 ; RTS
STA NEXTOP
JSR LLW
LDA #$C8 ; INY
STA NEXTOP
IDXLW JSR _LLW
JMP IDXW
;*
;* LOAD VALUE FROM ABSOLUTE ADDRESS
;*
LAB INY ;+INC_IP
_LAB INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
@ -568,8 +556,8 @@ LAB INY ;+INC_IP
STA ESTKL,X
LDA #$00
STA ESTKH,X
JMP NEXTOP
LAW INY ;+INC_IP
RTS
_LAW INY ;+INC_IP
LDA (IP),Y
STA TMPL
INY ;+INC_IP
@ -584,36 +572,24 @@ LAW INY ;+INC_IP
LDA (TMP),Y
STA ESTKH,X
LDY IPY
RTS
LAB JSR _LAB
JMP NEXTOP
LAW JSR _LAW
JMP NEXTOP
;*
;* ADD VALUE FROM ABSOLUTE ADDRESS
;*
ADDAB LDA #$60 ; RTS
STA NEXTOP
JSR LAB
LDA #$C8 ; INY
STA NEXTOP
ADDAB JSR _LAB
JMP ADD
ADDAW LDA #$60 ; RTS
STA NEXTOP
JSR LAW
LDA #$C8 ; INY
STA NEXTOP
ADDAW JSR _LAW
JMP ADD
;*
;* INDEX VALUE FROM ABSOLUTE ADDRESS
;*
IDXAB LDA #$60 ; RTS
STA NEXTOP
JSR LAB
LDA #$C8 ; INY
STA NEXTOP
IDXAB JSR _LAB
JMP IDXW
IDXAW LDA #$60 ; RTS
STA NEXTOP
JSR LAW
LDA #$C8 ; INY
STA NEXTOP
IDXAW JSR _LAW
JMP IDXW
;*
;* STORE VALUE TO ADDRESS

View File

@ -1017,57 +1017,143 @@ LLWX INY ;+INC_IP
;*
;* ADD VALUE FROM LOCAL FRAME OFFSET
;*
ADDLB LDA #$60 ; RTS
STA NEXTOP
JSR LLB
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDLBX LDA #$60 ; RTS
STA NEXTOP
JSR LLBX
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDLW LDA #$60 ; RTS
STA NEXTOP
JSR LLW
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDLWX LDA #$60 ; RTS
STA NEXTOP
JSR LLWX
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDLB INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
LDA (IFP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
BCC +
INC ESTKH,X
+ LDY IPY
JMP NEXTOP
ADDLBX INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
STA ALTRDOFF
LDA (IFP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
BCC +
INC ESTKH,X
+ STA ALTRDON
LDY IPY
JMP NEXTOP
ADDLW INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
LDA (IFP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
INY
LDA (IFP),Y
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
ADDLWX INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
STA ALTRDOFF
LDA (IFP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
INY
LDA (IFP),Y
ADC ESTKH,X
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOP
;*
;* INDEX VALUE FROM LOCAL FRAME OFFSET
;*
IDXLB LDA #$60 ; RTS
STA NEXTOP
JSR LLB
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXLBX LDA #$60 ; RTS
STA NEXTOP
JSR LLBX
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXLW LDA #$60 ; RTS
STA NEXTOP
JSR LLW
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXLWX LDA #$60 ; RTS
STA NEXTOP
JSR LLWX
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXLB INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
LDA (IFP),Y
LDY #$00
ASL
BCC +
INY
CLC
+ ADC ESTKL,X
STA ESTKL,X
TYA
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
IDXLBX INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
STA ALTRDOFF
LDA (IFP),Y
LDY #$00
ASL
BCC +
INY
CLC
+ ADC ESTKL,X
STA ESTKL,X
TYA
ADC ESTKH,X
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOP
IDXLW INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
STA TMPL
LDA (IFP),Y
ASL
STA TMPL
INY
LDA (IFP),Y
ROL
STA TMPH
LDA TMPL
CLC
ADC ESTKL,X
STA ESTKL,X
LDA TMPH
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
IDXLWX INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
STA ALTRDOFF
LDA (IFP),Y
ASL
STA TMPL
INY
LDA (IFP),Y
ROL
STA TMPH
LDA TMPL
CLC
ADC ESTKL,X
STA ESTKL,X
LDA TMPH
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
;*
;* LOAD VALUE FROM ABSOLUTE ADDRESS
;*
@ -1134,56 +1220,166 @@ LAWX INY ;+INC_IP
;*
;* ADD VALUE FROM ABSOLUTE ADDRESS
;*
ADDAB LDA #$60 ; RTS
STA NEXTOP
JSR LAB
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDABX LDA #$60 ; RTS
STA NEXTOP
JSR LABX
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDAW LDA #$60 ; RTS
STA NEXTOP
JSR LAW
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDAWX LDA #$60 ; RTS
STA NEXTOP
JSR LAWX
LDA #$C8 ; INY
STA NEXTOP
JMP ADD
ADDAB INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
LDA (ESTKH-2,X)
CLC
ADC ESTKL,X
STA ESTKL,X
BCC +
INC ESTKH,X
+ JMP NEXTOP
ADDABX INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
STA ALTRDOFF
LDA (ESTKH-2,X)
CLC
ADC ESTKL,X
STA ESTKL,X
BCC +
INC ESTKH,X
+ STA ALTRDON
JMP NEXTOP
ADDAW INY ;+INC_IP
LDA (IP),Y
STA TMPL
INY ;+INC_IP
LDA (IP),Y
STA TMPH
STY IPY
LDY #$00
LDA (TMP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
INY
LDA (TMP),Y
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
ADDAWX INY ;+INC_IP
LDA (IP),Y
STA TMPL
INY ;+INC_IP
LDA (IP),Y
STA TMPH
STY IPY
STA ALTRDOFF
LDY #$00
LDA (TMP),Y
CLC
ADC ESTKL,X
STA ESTKL,X
INY
LDA (TMP),Y
ADC ESTKH,X
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP NEXTOP
;*
;* INDEX VALUE FROM ABSOLUTE ADDRESS
;*
IDXAB LDA #$60 ; RTS
STA NEXTOP
JSR LAB
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXABX LDA #$60 ; RTS
STA NEXTOP
JSR LABX
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXAW LDA #$60 ; RTS
STA NEXTOP
JSR LAW
LDA #$C8 ; INY
STA NEXTOP
JMP IDXW
IDXAWX LDA #$60 ; RTS
STA NEXTOP
JSR LAWX
LDA #$C8 ; INY
STA NEXTOP
IDXAB INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
LDA (ESTKH-2,X)
STY IPY
LDY #$00
ASL
BCC +
INY
CLC
+ ADC ESTKL,X
STA ESTKL,X
TYA
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
IDXABX INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
STA ALTRDOFF
LDA (ESTKH-2,X)
STY IPY
LDY #$00
ASL
BCC +
INY
CLC
+ ADC ESTKL,X
STA ESTKL,X
TYA
ADC ESTKH,X
STA ESTKH,X
LDY IPY
STA ALTRDON
JMP NEXTOP
IDXAW INY ;+INC_IP
LDA (IP),Y
STA SRCL
INY ;+INC_IP
LDA (IP),Y
STA SRCH
STY IPY
LDY #$00
LDA (SRC),Y
ASL
STA TMPL
INY
LDA (SRC),Y
ROL
STA TMPH
LDA TMPL
CLC
ADC ESTKL,X
STA ESTKL,X
LDA TMPH
ADC ESTKH,X
STA ESTKH,X
LDY IPY
JMP NEXTOP
IDXAWX INY ;+INC_IP
LDA (IP),Y
STA SRCL
INY ;+INC_IP
LDA (IP),Y
STA SRCH
STY IPY
STA ALTRDOFF
LDY #$00
LDA (SRC),Y
ASL
STA TMPL
INY
LDA (SRC),Y
ROL
STA TMPH
LDA TMPL
CLC
ADC ESTKL,X
STA ESTKL,X
LDA TMPH
ADC ESTKH,X
STA ESTKH,X
STA ALTRDON
LDY IPY
JMP IDXW
;*
;* STORE VALUE TO ADDRESS

View File

@ -963,57 +963,105 @@ LLWX INY ;+INC_IP
;*
;* ADD VALUE FROM LOCAL FRAME OFFSET
;*
ADDLB LDX #$60 ; RTS
STX NEXTOP
JSR LLB
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDLBX LDX #$60 ; RTS
STX NEXTOP
JSR LLBX
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDLW LDX #$60 ; RTS
STX NEXTOP
JSR LLW
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDLWX LDX #$60 ; RTS
STX NEXTOP
JSR LLWX
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDLB INY ;+INC_IP
TYX
LDA (IP),Y
TAY
LDA (IFP),Y
AND #$00FF
TXY
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDLBX INY ;+INC_IP
TYX
LDA (IP),Y
TAY
STX ALTRDOFF
LDA (IFP),Y
STX ALTRDON
AND #$00FF
TXY
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDLW INY ;+INC_IP
TYX
LDA (IP),Y
TAY
LDA (IFP),Y
TXY
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDLWX INY ;+INC_IP
TYX
LDA (IP),Y
TAY
STX ALTRDOFF
LDA (IFP),Y
STX ALTRDON
TXY
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
;*
;* INDEX VALUE FROM LOCAL FRAME OFFSET
;*
IDXLB LDX #$60 ; RTS
STX NEXTOP
JSR LLB
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXLBX LDX #$60 ; RTS
STX NEXTOP
JSR LLBX
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXLW LDX #$60 ; RTS
STX NEXTOP
JSR LLW
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXLWX LDX #$60 ; RTS
STX NEXTOP
JSR LLWX
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXLB INY ;+INC_IP
TYX
LDA (IP),Y
TAY
LDA (IFP),Y
AND #$00FF
TXY
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXLBX INY ;+INC_IP
TYX
LDA (IP),Y
TAY
STX ALTRDOFF
LDA (IFP),Y
STX ALTRDON
AND #$00FF
TXY
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXLW INY ;+INC_IP
TYX
LDA (IP),Y
TAY
LDA (IFP),Y
TXY
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXLWX INY ;+INC_IP
TYX
LDA (IP),Y
TAY
STX ALTRDOFF
LDA (IFP),Y
STX ALTRDON
TXY
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
;*
;* LOAD VALUE FROM ABSOLUTE ADDRESS
;*
@ -1058,57 +1106,105 @@ LAWX INY ;+INC_IP
;*
;* ADD VALUE FROM ABSOLUTE ADDRESS
;*
ADDAB LDX #$60 ; RTS
STX NEXTOP
JSR LAB
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDABX LDX #$60 ; RTS
STX NEXTOP
JSR LABX
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDAW LDX #$60 ; RTS
STX NEXTOP
JSR LAW
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDAWX LDX #$60 ; RTS
STX NEXTOP
JSR LAWX
LDX #$C8 ; INY
STX NEXTOP
JMP ADD
ADDAB INY ;+INC_IP
LDA (IP),Y
STA TMP
TYA ; QUICKY CLEAR OUT MSB
+ACCMEM8 ; 8 BIT A/M
LDA (TMP)
+ACCMEM16 ; 16 BIT A/M
INY ;+INC_IP
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDABX INY ;+INC_IP
LDA (IP),Y
STA TMP
TYA ; QUICKY CLEAR OUT MSB
STX ALTRDOFF
+ACCMEM8 ; 8 BIT A/M
LDA (TMP)
+ACCMEM16 ; 16 BIT A/M
STX ALTRDON
INY ;+INC_IP
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDAW INY ;+INC_IP
LDA (IP),Y
STA TMP
LDA (TMP)
INY ;+INC_IP
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
ADDAWX INY ;+INC_IP
LDA (IP),Y
STA TMP
STX ALTRDOFF
LDA (TMP)
STX ALTRDON
INY ;+INC_IP
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
;*
;* INDEX VALUE FROM ABSOLUTE ADDRESS
;*
IDXAB LDX #$60 ; RTS
STX NEXTOP
JSR LAB
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXABX LDX #$60 ; RTS
STX NEXTOP
JSR LABX
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXAW LDX #$60 ; RTS
STX NEXTOP
JSR LAW
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXAWX LDX #$60 ; RTS
STX NEXTOP
JSR LAWX
LDX #$C8 ; INY
STX NEXTOP
JMP IDXW
IDXAB INY ;+INC_IP
LDA (IP),Y
STA TMP
TYA ; QUICKY CLEAR OUT MSB
+ACCMEM8 ; 8 BIT A/M
LDA (TMP)
+ACCMEM16 ; 16 BIT A/M
INY ;+INC_IP
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXABX INY ;+INC_IP
LDA (IP),Y
STA TMP
TYA ; QUICKY CLEAR OUT MSB
STX ALTRDOFF
+ACCMEM8 ; 8 BIT A/M
LDA (TMP)
+ACCMEM16 ; 16 BIT A/M
STX ALTRDON
INY ;+INC_IP
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXAW INY ;+INC_IP
LDA (IP),Y
STA TMP
LDA (TMP)
INY ;+INC_IP
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
IDXAWX INY ;+INC_IP
LDA (IP),Y
STA TMP
STX ALTRDOFF
LDA (TMP)
STX ALTRDON
INY ;+INC_IP
ASL
CLC
ADC TOS,S
STA TOS,S
JMP NEXTOP
;*
;* STORE VALUE TO ADDRESS
;*