Optimize handling of 9 bits offset in 6809 LZSA2 depacker

This commit is contained in:
Doug Masten 2020-06-26 15:18:53 -05:00
parent 061ca99838
commit 99db30a732

View File

@ -76,10 +76,8 @@ lz2nolt ldb ,s ; get token again, don't pop it from the stack
lda #$ff ; set bits 8-15 of offset lda #$ff ; set bits 8-15 of offset
bra lz2gotof bra lz2gotof
lz2offs9 clra ; clear A (to prepare for high 8 bits of offset) lz2offs9 sex ; extend token's Z flag bit into reg A
lslb ; push token's Z flag bit into carry deca ; set bits 9-15 of offset, reverse bit 8
rola ; shift Z flag from carry into bit 0 of A
coma ; set bits 9-15 of offset, reverse bit 8
ldb ,x+ ; load low 8 bits of (negative, signed) offset ldb ,x+ ; load low 8 bits of (negative, signed) offset
bra lz2gotof bra lz2gotof