>> I was really disappointed/shocked in the performance numbers Scott Edwards >> quoted in the article; they were something like 1,000x slower than what I >> would consider a "decent" compiler (I seem to remember that a hand-written >> assembler could be as much as 1,400x better) for the speed the PIC was >> running at. Now, it is 10-50x better than the STAMP, but it's really pretty >> slow. > >Which Pic BASIC was he talking about? PBASIC from Parallax is an >interpreter. The "compile" option merely copies the interpreter and the >P-Code into a PIC. Sorry for taking so long to reply; I had to find the original article. It's the Micro Engineering Labs BASIC - for $100.00. The article is in Scott Edward's April 1996 "Stamp Applications" of Nuts & Volts. In it, Scott shows the section of code: again: b1 = b1 + 1 ; increment b1 toggle 0 ; toggle pin 0 goto again and then goes on to give the following performance results: BS1, 4 MHZ 479 Hz . : 16C84, compiled 4 MHZ 7215 Hz Now, my thought was that any decent compiler would produce the following code: again incf b1 ; increment b1 movlw 0x01 ; toggle pin 0 xorwf PORTB ; Assume pin 0 is in PORTB goto again This can be improved to: movlw 0x01 ; Setup Pin to Toggle again incf b1 ; increment b1 xorwf PORTB ; toggle pin 0 goto again Although while I would expect this type of optimization for a workstation compiler, I wouldn't think that it would be reasonable for a Hobbyist one. 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 guess I exaggerated a bit for the relative improvement - I was talking about 1,000x when I should have said 30x. But, I think you can see that there is area for concern/improvement. Not only in terms of speed, but also in terms of instruction space; what is the PIC executing during this loop? >There are also one or two true Pic BASIC compilers out there that produce >native PIC code. > >The latter should be much faster than the former. According to the article, this Compiler is creating native code. 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