From efa2bf71a98a76ae9620ade2ab2fe161e619b681 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Fri, 14 Aug 2015 14:39:55 -0700 Subject: [PATCH] reorder for more speed and smaller size --- LZ4FH65816.S | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/LZ4FH65816.S b/LZ4FH65816.S index 9a4d12e..22ac5a7 100644 --- a/LZ4FH65816.S +++ b/LZ4FH65816.S @@ -55,7 +55,25 @@ entry inx and #$00ff cmp #lz4fh_magic + beq mainloop + +fail + jsr bell + jmp monitor + +notempty + cmp #tok_eod + +* exit + sec ;return to emulation mode + xce bne fail + rts + +* handle "special" match length values (in A) +specialmatch + cmp #tok_empty + bne notempty mainloop lda $0000,x @@ -73,8 +91,7 @@ mainloop lda $0000,x ;length >= 15, get next inx and #$00ff - clc - adc #15 + adc #14 ;(carry set) add 15 - will not exceed 255 * At this point, Y holds the address of the next * compressed data byte, X has the address of the @@ -114,23 +131,3 @@ _dstmod ora #$ff00 ;OR in hi-res page mvn $00,$00 plx ;restore srcptr bra mainloop - -* handle "special" match length values (in A) -specialmatch - cmp #tok_empty - beq mainloop ;empty match, just loop - - cmp #tok_eod - bne fail - -* exit - sec ;return to emulation mode - xce - rts - -fail - sec - xce - jsr bell - jmp monitor -