I'm a little hesitant in posting this...  I've been known to
be wrong on occasion (quite a few, if you ask my wife).
However, here goes anyway.  Given the following code fragment:

unsigned long count = 0;
unsigned long bar = 0;

void foo(void)
{
  if (++count == 0)
    bar++;
}

'bar' will be increment once for each increment of 'count' for
as long as the upper byte of 'count' is zero.

I have followed this code at the assembly level using the
simulator.  It doesn't look like the fault is with the simulator.
The code appears to be checking ONLY if the upper byte of 'count'
is zero.

-Bill Knight
R O SoftWare



Reply via email to