Merge pull request #11 from peterferrie/master

smaller
This commit is contained in:
Emmanuel Marty 2019-07-10 22:35:01 +02:00 committed by GitHub
commit 36e7316f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,10 +81,7 @@ NO_LITERALS
BMI GET_LONG_OFFSET ; $80: 16 bit offset
JSR GETSRC ; get 8 bit offset from stream in A
CLC ; add dest + match offset
ADC PUTDST+1 ; low 8 bits
STA COPY_MATCH_LOOP+1 ; store back reference address
TAX ; save for later
LDA #$0FF ; high 8 bits
BNE GOT_OFFSET ; go prepare match
; (*like JMP GOT_OFFSET but shorter)
@ -117,6 +114,7 @@ GETMATCH_INC_HI
GET_LONG_OFFSET ; handle 16 bit offset:
JSR GETLARGESRC ; grab low 8 bits in X, high 8 bits in A
GOT_OFFSET
STA OFFSHI ; store high 8 bits of offset
TXA
@ -126,14 +124,12 @@ GET_LONG_OFFSET ; handle 16 bit offset:
OFFSHI = *+1
LDA #$AA ; high 8 bits
GOT_OFFSET
ADC PUTDST+2
STA COPY_MATCH_LOOP+2 ; store high 8 bits of address
PLA ; retrieve token from stack again
AND #$0F ; isolate match len (MMMM)
CLC
ADC #$03
ADC #$02 ; plus carry which is always set by the high ADC
CMP #$12 ; MATCH_RUN_LEN?
BNE PREPARE_COPY_MATCH ; if not, count is directly embedded in token