??? 07/31/05 00:50 Read: times |
#98489 - LSB count value lost in first count Responding to: ???'s previous message |
Inner loop distroy the LSB count value on R7 after the fist count of the outer loop. Method to preserve and restore the LSB count when the inner loop finish should be added
Suggested soln 1: Delay: ;; here mov r5,r7 loop: djnz r7,loop mov r7,r5 djnz r6,loop ret or suggested soln 2: Delay: ;; here outerloop: push ar7 loop: djnz r7,loop pop ar7 djnz r6,outerloop ret Ofcourse the number of cycles consumed in the delay subroutine should be recalculated. Happy ASM programming! 73,Li. |