??? 07/25/05 13:24 Read: times |
#97997 - my loop for >256 itterations Responding to: ???'s previous message |
hi,
when I need to do some task more than 256 times, I use next routine: LOOP_CYCLE_0: DEC R7 LOOP_CYCLE_1: DEC R6 CALL A_TASK ; or NOP or just empty line LOOP_CYCLE: CJNE R6,#0,LOOP_CYCLE_1 CJNE R7,#0,LOOP_CYCLE_0 RETThen in program I call LOOP_CYCLE routine. By this way I need not "compensate" DJNZ and just load exactly needed value into R6(low)/R7(high) pair. From other side, such way works some slowly but in case of delay it is not a point. Regards, Oleg |