Professional Documents
Culture Documents
Counting Number of 0's & 1's - Code Conversion
Counting Number of 0's & 1's - Code Conversion
LABEL
back
skip last
MNEUMONICS MOV R2, #00 MOV R3, #00 MOV R1, #08 MOV R0, #DATA MOV A,R0 RRC A JC skip INC R3 AJMP last INC R2 DJNZ R1, back
COMMENTS Move 00 to R2 Move 00 to R3 Move 08 to R1 Move DATA to R0 Move R0 to A Rotate Right A Jump if carry to skip Increment R3 Jump to LAST Increment R2 Jump if R1 is not zero to back CODE CONVERSION USING 8051 (BINARY TO GRA)
LABEL
COMMENTS Move DATA to A Move A to R0 Rotate Right R0 XOR A with R0 LCALL(SUBROUTINE CALL)