use 8051 Keil Assembler change the minimum count to the valu
use 8051 Keil Assembler, change the minimum count to the value of the month you were born and observe the LEDs counting down to the number, in this activity, use DIP switches to set the start count. A) If we use CJNE(Compare Jump Not Equal) instruction. Explain how it works.B) in 8051, do we have CJE(compare jump equal) instruction?
Solution
ORG 0000H
MOV P1,#0FFH // INPUT PORT
MOV R0,#08H // MONTH
HERE : JNB P1.0 , HERE // MONITORES THE SWITCH CONNECTED TO P1.0
AGAIN : MOV P0 , R0 // OUTPUT THE COUNT VALUE TO PORT 0 CONNECTED TO LEDS
DEC R0 // DECREMENTS COUNTER
CJNE R0, #00H , AGAIN // COMPARES AND JUMPS IF NOT EQUAL TO 00H
END
CJNE : It first compares with the data next to it (here 00H) with the value of the register, if the value of both is not equal then it jumps to address location mentioned next to it (here AGAIN). If the value is equal then then next instruction is executed.
No. there is no CJE instruction in 8051 assembly
