Walter Banks said: >> >The first loop takes five instruction cycles to run (the second four) - five >> >instructions running at 4 Mhz (1 MHz Instruction cycle frequency) means that >> >the loop would run at 200 KHz. > >I think the output would be more likely to be 100KHz. 5 instructions on and 5 >instructions off. Sorry, yes, you're right. I meant to say that the loop would execute at 200 KHz, not the LCD flashing. >> I checked our multi-target Basic compiler with PIC as target with your >> code and got 50 KHz for the same loop. > >I just checked the MPC compiler and it generates the 5 instruction sequence > first >shown above. > >One of our other compilers surprised me with the following code sequence > equivalent. > > > movlw 0x01 ; Setup Pin to Toggle >again > xorwf PORTB ; toggle pin 0 > goto again > >The missing increment was caused by a default non-volitile variable that was > never >again referenced in the program. Its value did not matter. I'm impressed; that's the sort of performance I would expect from a professional compiler. >True comparitive benchmarks are tough to write. This may sound cynical, but I don't know if there's any such beast as a "True comparitive benchmark". Any benchmarks I've seen seem to be more marketing tools than anything else (anybody else remember the Intel i86 vs. Motorola 68K benchmarking fiasco of the early '80s?). myke Today, the commercial sector is advancing computer and communication technology at a breakneck pace. In 1992, optical fiber was being installed within the continental U.S. at rates approaching the speed of sound (if computed as total miles of fiber divided by the number of seconds in the year). Aviation Week and Space Technology, October 28, 1996