Reversing bits in a byte with AVR
问题 I am currently working on a problem that wants me to build a subroutine that will reverse the bits in R16. 00000011 => 11000000 or 10101000 => 00010101 For the class we are using the AVR subset and the subroutine needs to work in norfair. This is what I have so far, any help would be appreciated! ldi r16,3 ;00000011 回答1: The naive solution is to loop through the bits with the shift operator and check. But be aware that AVR doesn't have a barrel shifter so it can only shift by 1, any other