Prev: 924E Up: Map Next: 9285
9255: Read B bits into A
Used by the routines at decompress_patterns and decompress_write_byte.
read_b_bits_into_a 9255 LD B,$08 Read 8 bits
This entry point is used by the routine at decompress_patterns.
read_b_bits_into_a_0 9257 XOR A Result
read_b_bits_into_a_1 9258 PUSH BC Push number of bits to read
9259 PUSH AF Push result
925A LD A,(decoder_bits_left) Number of bits left in current byte
925D DEC A Decrement
925E JP P,read_b_bits_into_a_2 Skip ahead if there are still bits left
9261 INC HL Increment source address
9262 LD A,(HL) get source byte
9263 LD (decoder_source_byte),A Save source byte
9266 LD BC,(decoder_length) Byte counter
926A DEC BC Decrement
926B LD (decoder_length),BC And save
926F LD A,$07 8 bits - 1 left
read_b_bits_into_a_2 9271 LD (decoder_bits_left),A Save bits left
9274 LD A,(decoder_source_byte) Get source byte
9277 RLA Rotate left through carry
9278 LD (decoder_source_byte),A Save again
927B RL B Rotate carry into bite 0
927D POP AF Pop result
927E RR B Rotate bit 0 into carry
9280 RLA Rotate carry into result
9281 POP BC Pop number of bits to read
9282 DJNZ read_b_bits_into_a_1 Repeat for n bits
9284 RET
Prev: 924E Up: Map Next: 9285