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

Early exit caseblock if value less than ordered list

This commit is contained in:
David Schmenk 2018-03-16 15:14:58 -07:00
parent ec0fdde747
commit 010750efed

View File

@ -1380,8 +1380,10 @@ SEL TYA ; FLATTEN IP
PLA
INC IP
CASELP CMP (IP),Y
BEQ ++
INY
BEQ +
BVS ++
BMI CASEEND ; CASE VALS IN ASCENDING ORDER, EXIT WHEN LESS
- INY
INY
INY
DEX
@ -1392,14 +1394,21 @@ CASELP CMP (IP),Y
INC IPH
+ACCMEM16 ; 16 BIT A/M
BRA CASELP
+ INY
BRA BRNCH
++ BPL -
CASEEND TXA ; SKIP REMAINING CASES
ASL
ASL
CLC
ADC IP
STA IP
FIXNEXT TYA
LDY #$00
SEC
ADC IP
STA IP
JMP FETCHOP
++ INY
BRA BRNCH
BRAND LDA TOS,S
BEQ BRNCH
PLA ; DROP LEFT HALF OF AND