Assembly language programming

 Write an 8085 ALP to find the number of 1’s binary representation of given 8-bit number.

1. MVI A 08; set data in accumulator 
2. LXI B 0008; set bit counter and 1's counter 
3. L2: RAL; rotate left accumulator data through carry 
4. JNC L1; jump if carry is set to 0 
5. INR B; increment data of register B 
6. L1: DCR C; decrement data of register C 
7. JNZ L2; jump if data of register C is not 0
8. HLT; holt program

Post a Comment

0 Comments