From 1dd65731c4e4f495c9b7fa280a5320cb3d736b8d Mon Sep 17 00:00:00 2001 From: Doug Masten Date: Sat, 20 Jun 2020 12:19:32 -0500 Subject: [PATCH] Remove unnecessary "ADDB #$12" as B register will always have this value from 6809 LZSA depackers --- asm/6809/unlzsa1.s | 3 +-- asm/6809/unlzsa1b.s | 3 +-- asm/6809/unlzsa2.s | 3 +-- asm/6809/unlzsa2b.s | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/asm/6809/unlzsa1.s b/asm/6809/unlzsa1.s index b23b8a0..16abd6a 100644 --- a/asm/6809/unlzsa1.s +++ b/asm/6809/unlzsa1.s @@ -78,8 +78,7 @@ lz1gotof leau d,y ; put backreference start address in U (dst+offset) cmpb #$12 ; MATCH_RUN_LEN? bne lz1gotln ; no, we have the full match length, go copy - ldb ,x+ ; grab extra match length byte - addb #$12 ; add MIN_MATCH_SIZE + MATCH_RUN_LEN + addb ,x+ ; add extra match length byte + MIN_MATCH_SIZE + MATCH_RUN_LEN bcc lz1gotln ; if no overflow, we have the full length bne lz1midln diff --git a/asm/6809/unlzsa1b.s b/asm/6809/unlzsa1b.s index 6b97d92..7afeb40 100644 --- a/asm/6809/unlzsa1b.s +++ b/asm/6809/unlzsa1b.s @@ -82,8 +82,7 @@ lz1gotof nega ; reverse sign of offset in D cmpb #$12 ; MATCH_RUN_LEN? bne lz1gotln ; no, we have the full match length, go copy - ldb ,-x ; grab extra match length byte - addb #$12 ; add MIN_MATCH_SIZE + MATCH_RUN_LEN + addb ,-x ; add extra match length byte + MIN_MATCH_SIZE + MATCH_RUN_LEN bcc lz1gotln ; if no overflow, we have the full length bne lz1midln diff --git a/asm/6809/unlzsa2.s b/asm/6809/unlzsa2.s index f99c453..3788620 100644 --- a/asm/6809/unlzsa2.s +++ b/asm/6809/unlzsa2.s @@ -40,8 +40,7 @@ lz2token ldb ,x+ ; load next token into B: XYZ|LL|MMM cmpb #$12 ; LITERALS_RUN_LEN_V2 + 15 ? bne lz2gotlt ; if not, we have the full literals count, go copy - ldb ,x+ ; load extra literals count byte - addb #$12 ; add LITERALS_RUN_LEN + 15 + addb ,x+ ; add extra literals count byte + LITERALS_RUN_LEN + 15 bcc lz2gotlt ; if no overflow, we got the complete count, copy ldb ,x+ ; load low 8 bits of little-endian literals count diff --git a/asm/6809/unlzsa2b.s b/asm/6809/unlzsa2b.s index 162f972..0bcfd3f 100644 --- a/asm/6809/unlzsa2b.s +++ b/asm/6809/unlzsa2b.s @@ -42,8 +42,7 @@ lz2token ldb ,-x ; load next token into B: XYZ|LL|MMM cmpb #$12 ; LITERALS_RUN_LEN_V2 + 15 ? bne lz2gotlt ; if not, we have the full literals count, go copy - ldb ,-x ; load extra literals count byte - addb #$12 ; add LITERALS_RUN_LEN + 15 + addb ,-x ; add extra literals count byte + LITERALS_RUN_LEN + 15 bcc lz2gotlt ; if no overflow, we got the complete count, copy ldd ,--x ; load 16 bit count in D (low part in B, high in A)