
Site Search
Rotating the Bits of Accumulator 'RIGHT TO LEFT', Assembly Language Instruction 'RR & RL' , Time Delay 0.125 Second

Rotating the Bits of Accumulator 'RIGHT TO LEFT', Assembly Language Instruction 'RR & RL' , Time Delay 0.125s
;=================================================================
;Code Written by: Azhar Ahmed
; W W W . I A M T E C H N I C A L . C O M
;Crystal Frequency = 12MHz / 12 Machine Cycles = 1Mhz
;1/1MHz = 1 Microsecond
;(250 x 250 x 2 x 1Microsecond) x 1 time ACALL Delay = 0.125 Second
;=================================================================
ORG 0000H
BACK: MOV A,#10000000B ;Load 80H in HEX or 100000000B in Binary at Port1
MOV P1,A ;Load 80H in HEX or 10000000B in Binary to Accumulator
ACALL DELAY ;WAIT 0.125 Second
RR A ;Rotate The Bits of Accumulator Right i.e 01000000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00100000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00010000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00001000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00000100B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00000010B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 00000001B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RR A ;Rotate The Bits of Accumulator Right i.e 10000000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00000001B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00000010B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00000100B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00001000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00010000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 00100000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 01000000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
RL A ;Rotate The Bits of Accumulator Left i.e 10000000B
MOV P1,A ;Load the Rotated Bits at the Port1
ACALL DELAY ;Wait 0.123 Second
SJMP BACK ;Make This Operation to Run Repeatedly
DELAY:
MOV R0,#250 ;Initialize the R0 Register With an Immediate Value 250
NEXT:
MOV R1,#250 ;Load R0 With 250 Value to Repeat the Loop for 250 Times
AGAIN:
DJNZ R1,AGAIN ;Internal Loop Repeates 250 Times
DJNZ R0,NEXT ;External Loop Repeates 250 Times
RET ;Return to Caller
END ;End of .asm File