/* Given 8-bit unsigned variables A and B, each holding an 8-bit signed 2's complement number, * write a program to find the average of A and B and put the result into variable C. * Hint: Shifting (or rotating) a binary number to the left is equivalent to dividing by 2. */ .INCLUDE .DSEG A: .BYTE 1 B: .BYTE 1 C: .BYTE 1 .CSEG Avg: lds r16, A ; load lds r17, B add r16, r17 ; add ror r16 ; divide by 2 (include carry) sts C, r16 ; store rjmp Avg