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

6502 caseblock early exit test

This commit is contained in:
David Schmenk 2018-03-17 08:44:02 -07:00
parent c02bcd413d
commit d379cefe2a
2 changed files with 56 additions and 18 deletions

View File

@ -814,20 +814,17 @@ SEL INX
DEY
LDA (IP),Y
STA TMPL ; CASE COUNT
LDA ESTKL-1,X
INC IPL
BNE CASELP
INC IPH
CASELP CMP (IP),Y
BNE +
CASELP LDA ESTKL-1,X
CMP (IP),Y
BEQ +
LDA ESTKH-1,X
INY
CMP (IP),Y
BEQ BRNCH
LDA ESTKL-1,X
DEY
+ INY
INY
SBC (IP),Y
BMI CASEEND
- INY
INY
DEC TMPL
BEQ FIXNEXT
@ -835,6 +832,28 @@ CASELP CMP (IP),Y
BNE CASELP
INC IPH
BNE CASELP
+ LDA ESTKH-1,X
INY
SBC (IP),Y
BEQ BRNCH
BPL -
CASEEND LDA #$00
STA TMPH
LDA TMPL
ASL ; SKIP REMAINING CASES
ROL TMPH
ASL
ROL TMPH
SBC #$00 ; CARRY CLEAR = SUB #1
BCS +
DEC TMPH
+ CLC
ADC IPL
STA IPL
LDA TMPH
ADC IPH
STA IPH
DEY
FIXNEXT TYA
LDY #$00
SEC

View File

@ -1606,20 +1606,17 @@ SEL INX
DEY
LDA (IP),Y
STA TMPL ; CASE COUNT
LDA ESTKL-1,X
INC IPL
BNE CASELP
INC IPH
CASELP CMP (IP),Y
BNE +
CASELP LDA ESTKL-1,X
CMP (IP),Y
BEQ +
LDA ESTKH-1,X
INY
CMP (IP),Y
BEQ BRNCH
LDA ESTKL-1,X
DEY
+ INY
INY
SBC (IP),Y
BMI CASEEND
- INY
INY
DEC TMPL
BEQ FIXNEXT
@ -1627,6 +1624,28 @@ CASELP CMP (IP),Y
BNE CASELP
INC IPH
BNE CASELP
+ LDA ESTKH-1,X
INY
SBC (IP),Y
BEQ BRNCH
BPL -
CASEEND LDA #$00
STA TMPH
LDA TMPL
ASL ; SKIP REMAINING CASES
ROL TMPH
ASL
ROL TMPH
SBC #$00 ; CARRY CLEAR = SUB #1
BCS +
DEC TMPH
+ CLC
ADC IPL
STA IPL
LDA TMPH
ADC IPH
STA IPH
DEY
FIXNEXT TYA
LDY #$00
SEC