Loop 1 delay 1 = 4 Delayloop decfsz Goto delay 1, f Delay. Loop 1 MC delay 1 = 3 2 MC decfsz Goto delay 1, f Delay. Loop 1 MC delay 1 = 2 2 MC decfsz Goto delay 1, f Delay. Loop 1 MC delay 1 = 1 2 MC decfsz delay 1, f 2 MC delay 1 = 0 T = 3(41)+2 T = 11
Full Loop 1 delay 1 = 0 Delayloop decfsz Goto … decfsz Goto T = 3(256 -1)+2 T = 767 MC delay 1, f 1 MC delay 1 = 255 Delay. Loop 2 MC delay 1, f 1 MC delay 1 = 1 Delay. Loop 2 MC decfsz delay 1, f 2 MC delay 1 = 0
Second Loop delay 2 = 3 Delayloop Full Loop 1 decfsz Goto delay 2, f Delay. Loop T = (Full. Loop 1+3)(delay 2 -1) T = (767+3)*3 +2 = 2303 M 767 MC 2 MC 1 MC delay 2 = 2 Full Loop 1 decfsz delay 2, f Goto Delay. Loop 767 MC 1 MC delay 2 = 1 2 MC Full Loop 1 decfsz delay 2, f 767 MC 2 MC delay 2 = 0
Second Full delay 2 = 0 Delayloop Full Loop 1 decfsz Goto delay 2, f Delay. Loop T = (Full. Loop 1+3)(256 -1)+2 T = (767+3)*255 +2 = 195587 MC 767 MC 2 MC 1 MC delay 2 = 255 Full Loop 1 decfsz delay 2, f Goto Delay. Loop 767 MC 1 MC delay 2 = 1 2 MC Full Loop 1 decfsz delay 2, f 767 MC 2 MC Tn = 2+ (Tn-1 + 3)(delayvalue-1) delay 2 = 0
MC with Full Mode
Example cnt 1 = 171 cnt 2 = 24 cnt 3 = 6 Delay. Loop decfsz cnt 1, f Goto Delay. Loop decfsz cnt 2, f Goto Delay. Loop decfsz cnt 3, f Goto Delay. Loop
Example • T 0 = 2+ (171 -1)(3) = 512 • T 1 = 2+ (24 -1)(767+3) = 17712 • T 2 = 2 + (6 -1)(196352 + 3) = 981775 • Total = T 0+T 1+T 2 = 512+17712+981775 = 999999