![]() |
Routines |
| Prev: 9A50 | Up: Map | Next: 9A9D |
|
Used by the routines at DrawGraphic_Mirrored and DrawGraphic_RotatedHalf.
Reverses the order of the bits in a byte.
|
||||||||||||
| ReverseBits | 9A92 | PUSH BC | Stash BC on the stack. | |||||||||
| 9A93 | LD B,$08 | B=08 (the number of bits to reverse). | ||||||||||
| ReverseBits_Loop | 9A95 | RLA | Rotate the top bit of A into the carry flag. | |||||||||
| 9A96 | RR C | Rotate the carry flag into the top of C. | ||||||||||
| 9A98 | DJNZ ReverseBits_Loop | Decrease the bit counter by one and loop back to ReverseBits_Loop until all eight bits have been reversed. | ||||||||||
| 9A9A | LD A,C | Fetch the reversed byte. | ||||||||||
| 9A9B | POP BC | Restore BC from the stack. | ||||||||||
| 9A9C | RET | Return. | ||||||||||
| Prev: 9A50 | Up: Map | Next: 9A9D |