playground:reversing_bits_in_a_byte
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
playground:reversing_bits_in_a_byte [2020-02-14 22:46] – verz | playground:reversing_bits_in_a_byte [2020-02-22 18:40] – verz | ||
---|---|---|---|
Line 21: | Line 21: | ||
-- | -- | ||
- | this would be faster | + | this would be equally fast, at 100cycl +rts (enter with the value in .A, result in .A, .X will be 0) |
< | < | ||
ldx #8 | ldx #8 | ||
Line 30: | Line 30: | ||
lda $2 | lda $2 | ||
+ | rts | ||
+ | </ | ||
+ | |||
+ | or unrolled (56 cycl +rts): | ||
+ | < | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | ror $2 | ||
+ | asl | ||
+ | lda $2 | ||
+ | ror | ||
rts | rts | ||
</ | </ | ||
playground/reversing_bits_in_a_byte.txt · Last modified: 2020-03-12 13:05 by tlr