Quote:
Originally Posted by Don Rotolo
...My question has to do with the relative load on the CPU for the various programmatical operations that can be performed...
|
The PIC processor is designed so that every operation takes one clock cycle. Branch instructions are an exception; they take two. But the architecture of the PIC CPU is unusual in that read/write data and program code are not in the same memory space, and the ALU has some odd restrictions on where the results end up. This means that what looks like a simple operation in C might end up being a simple operation on the PIC -- or it might end up being a page of assembly language to implement. Floating point arithmetic is particularly costly, as the PIC ALU doesn't support floating point in hardware.
If you're interested in the relative cost in program space (which translates almost directly to execution time) for various operations, I suggest you try compiling a program which uses those operations and then inspect the listing file to see how the compiler translates them into PIC assembly language.