ABSF WROTE:Because the 16F RAM registers are all 8 bit wide, it has to split into 3 smaller loops. If using 18F, where the RAM registers are 16 bits wide, the program would need only 2 variables with larger constant values and it should be able to run faster.
Allen
Allen, actually 16F and 18F have the same 8-bit RAM size. PIC18F have 16-bit wide instruction set, this mean each instruction set, for example MOVWF will take 16-bit of space in program memory, but the CPU/ALU can only process 8-bit data.
There are 2 scenarios that we can compare here. Between PIC16F and PIC18F, and between 2 type of C compiler.
I would agree with shiyan about the compiler differences. Even with C18 and HITECH compiler, there is a feature called optimization. This optimization will actually decide how optimize the C code is translate into assembly before turning into hex code. If the optimization is good, the hex code will be smaller in size and of course faster execution time. HITECH is well known for high code optimization.
As for PIC16F compare with PIC18F, though both are 8-bit MCU, there are significant differences between their instruction sets. PIC16F has around 35 instruction sets while PIC18F have 77 instruction sets (normal case). These instruction sets will actually determine the time and length of certain subroutine in C.