diff --git a/asm/6502/decompress_fast_v2.asm b/asm/6502/decompress_fast_v2.asm index 6b390e3..1e49a75 100644 --- a/asm/6502/decompress_fast_v2.asm +++ b/asm/6502/decompress_fast_v2.asm @@ -114,10 +114,9 @@ NO_LITERALS BNE GOT_OFFSET_LO ; go store low byte of match offset and prepare match OFFSET_9_BIT ; 01Z: 9 bit offset - ROL - ROL - AND #$01 - EOR #$FF ; set offset bits 15-9 to 1 + ROL ; carry: Z bit; A: xxxxxxx1 (carry known set from BCS OFFSET_9_BIT) + ADC #$00 ; if Z bit is set, add 1 to A (bit 0 of A is now 0), otherwise bit 0 is 1 + ORA #$FE ; set offset bits 15-9 to 1. reversed Z is already in bit 0 BNE GOT_OFFSET_HI ; go store high byte, read low byte of match offset and prepare match ; (*same as JMP GOT_OFFSET_HI but shorter)