| ??? 11/12/02 11:49 Read: times |
#32351 - RE: decode this delay300ms subroutine. helo! |
<html>
The 12 and 24 cycles in the comments are cycles of the crystal used to drive the 8051, see 12 crystal cycles = 1 machine cycle, the MOV is 1 machine cycle and the DJNZ is 2 machine cycles, so 12 and 24 crystal cycles. See the DJNZ instruction description in the instruction set, he is using this instruction to loop. He loads R5 with 0, on the first Decrement and Jump if Not Zero (DJNZ) instruction, R5 will be decremented and so will contain 255. So that instruction will jump back 256 times, to DL300L. The comment for the R5 DJNZ also shows 177 because this line will be executed 177 times by the DJNZ R6 line (he has loaded 177 into R6). To use one register instead of three, he could have alternated the MOVs and DJNZs and added labels and NOPs, but maybe he is short on ROM and not worried about registers. <table><tr><td>james</td><td> </td><td> www.jameshinnant.com</td></tr></table> </html> |
| Topic | Author | Date |
| decode this delay300ms subroutine. helo! | 01/01/70 00:00 | |
| RE: decode this delay300ms subroutine. helo! | 01/01/70 00:00 | |
| RE: decode this delay300ms subroutine. helo! | 01/01/70 00:00 | |
RE: decode this delay300ms subroutine. helo! | 01/01/70 00:00 |



