From a1841e5e5d38223fa9c7a7752b15e72fa4c3ad78 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 10 Jul 2019 10:48:15 -0700 Subject: [PATCH 1/2] smaller --- asm/6502/decompress_v1.asm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/asm/6502/decompress_v1.asm b/asm/6502/decompress_v1.asm index f24d493..ca22f4a 100755 --- a/asm/6502/decompress_v1.asm +++ b/asm/6502/decompress_v1.asm @@ -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,7 +124,6 @@ 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 From 8e26fa9cacc4882d53667ac43075c62ecf974a0e Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 10 Jul 2019 10:57:41 -0700 Subject: [PATCH 2/2] smaller --- asm/6502/decompress_v1.asm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asm/6502/decompress_v1.asm b/asm/6502/decompress_v1.asm index ca22f4a..743e3c7 100755 --- a/asm/6502/decompress_v1.asm +++ b/asm/6502/decompress_v1.asm @@ -129,8 +129,7 @@ OFFSHI = *+1 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