1. The followingCcode counts the number of 1 bits in u8_j and returns the answer in u8_k. Convert this to PIC24 assembly code. You may want to convert the for loop structure to a while loop structure.
uint8_t u8_i,u8_j,u8_k;
u8_k = 0; // init bit count
for (u8_i = 0; u8_i != 8; u8_i++) { // do for 8 bits
if ((u8_j & 0x01) == 1) {
u8_k++; // LSb = 1, increment count
}
u8_j = u8_j >> 1; // look at the next bit
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here