Microcontroller time delay

MrChips

Joined Oct 2, 2009
34,810
The loop is executed 256 times. if number=0 then when -1 is taken away from it, the content of R0 becomes the binary value of 11111111 and 255 decimal, so far loop is executed once, then there are the other 255 times that the loop would be executed making it 256 times in total.
That is correct. When working with microcontrollers it is very important to pay attention to details.

if number=0 then when -1 is taken away from it,...
What you really mean to say is 1 is taken away from it.
 
Top