diff --git a/z80_unpacker/unpack.asm b/z80_unpacker/unpack.asm index 300579d..e0218e9 100644 --- a/z80_unpacker/unpack.asm +++ b/z80_unpacker/unpack.asm @@ -316,6 +316,21 @@ decode_number: jr c,.fix_bit_pos ; until stop bit is reached (all bits did land to correct position) ret ; return with CF=0 (important for unpack routine) + DISPLAY "upkr.unpack total size: ",/D,$-unpack + + ; reserve space for probs array without emitting any machine code (using only EQU) + + IFDEF UPKR_PROBS_ORIGIN ; if specific address is defined by user, move probs array there +probs: EQU ((UPKR_PROBS_ORIGIN) + 255) & -$100 ; probs array aligned to 256 + ELSE +probs: EQU ($ + 255) & -$100 ; probs array aligned to 256 + ENDIF +.real_c: EQU 1 + 255 + 1 + 2*NUMBER_BITS ; real size of probs array +.c: EQU (.real_c + 1) & -2 ; padding to even size (required by init code) +.e: EQU probs + .c + + DISPLAY "upkr.unpack probs array placed at: ",/A,probs,",\tsize: ",/A,probs.c + /* archived: negligibly faster but +6B longer decode_number variant using HL' and BC' to do `number|=(1<