-
The loop is either executed first and judged later, or judged first and then executed.
Either way, it is performed 3 times.
r6=03h djnz r6, execute first and then judge: execute, judge 3-1=2 is not zero; execute, judging that 2-1=1 is not zero; executed, and the cycle 1-1=0 is judged to be zero. So it was done 3 times.
-
Subtract once at the end of each loop, and count how many times you subtract yourself? The first cycle ends when 3-1=2, the second cycle ends when 2-1=1, and the third cycle ends when 1-1=0.
-
Let's assume r6 = 03h
djnz r6, $3-1=2 once, 2-1=1 twice, 1-1=0 three times, after three executions = 0 , down to the next level.
-
Pay attention to the format of DJNZ.
loop.
djnz r6,loop
The first time it was executed to DJNZ, the loop ** had already been executed once, so with the next two times you said, it was three times.
-
mov r6,#03h
mov r7,#00h
loop:inc r7
djnz r6,loop
You see, the above paragraph **, after execution, r7=?, I understand it, and I know why I said it 3 times.
-
It's an endless loop, r0 can never be reduced to 0. Every time you subtract 1 and don't get zero, you jump to the loop and continue to execute, and then r0 is 3 again, so you can never jump out!
-
It's an endless loop.
The correct way to write it is:
mov r0,#
loop:…djnz r0,loop
Cycle three times.
-
mov r0,#38;or MOV R0, 26H; All right, but note that the previous sentence is a decimal number without an h. The cycle * times you said only refers to the decimal system, so it is more convenient to copy it directly in the decimal system if you define the number of times. In other bases, use the number of decimal cycles you want.
-
JZ: Jump Zero.
jnz: jump not zero transfer cjne: compare jump not equal
djnz: decrease jump not zero minus 1 does not transfer to zero.
-
The single-chip microcomputer communicates with the single-chip microcomputer, and the direct serial port docking can be done (txd1 - rxd2, rxd1 - txd2).
Multi-machine communication set up a host, (txd1 - rxd2 - rxd3 --rxdn , rxd1 - txd2 - txd3 --txdn )
The way is similar to PC and MCU. Note that the baud rate should be the same.
It's as simple as letting the 8 LEDs controlled by the P1 port flash back and forth three times in sequence. >>>More
Ignoring the influence of temperature and other factors, the method of measuring voltage by series resistance can be directly adopted. >>>More
Just learn 51 first, the absolute entry-level, you can choose Guo Tianxiang's for the development board, it's been many years, the information is very complete, and then you can look at 32 or something.
Hello: I wrote the program:
#include >>>More
If you really want to learn, you don't need to buy a development board. Find a minimal system board, then learn something, buy components and build small circuits by yourself. Run the electronic market by yourself, build the circuit by yourself, in order to know the problem, in order to learn something, buy a development board, according to the circuit on the manual, and then put the program into it, and then the program basically understands, this is not called learning... >>>More