
Originally Posted by
T.Jackson
Repeat is the same as a conditional (DO Loop) ?
Yes indeed.
Main reason DO's are faster is because unlike For Nexts, they don't have counters.
mmm yes and no. Here what reduce the speed is more likely the .0[Temp] stuff. Let's see
Code:
@ SIZESTART
for temp = 0 to 7
next temp
@ SIZEEND "FOR-TO-NEXT"
@ SIZESTART
temp = 0
repeat
temp=temp+1
until temp = 8
@ SIZEEND "REPEAT - UNTIL"
FOR-TO-NEXT: 13 WORDS, 113 UsEC
REPEAT - UNTIL: 9 WORDS, 72 UsEC
about the same code space, 41uSec of difference in the speed for the whole thing.
But now, have a look at this
Code:
@ SIZESTART
Summe_Alarm.0 = 0
@ SIZEEND "Direct Bit Addressing"
@ SIZESTART
temp = 0
summe_Alarm.0[temp] = 0
@ SIZEEND ".0[Temp] stuff"
Direct Byte Addressing: 1 WORDS, 1 UsEC
.0[Temp] stuff: 10 WORDS, 47 UsEC
That's 46 uSec BY single instructions/lines like that. So... much revealant when you use them a loop that the loop itself.
Last edited by mister_e; - 28th May 2007 at 04:56.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks