I have just started with C after 15-years of assembly programming 
I have downloaded PICC 9.83 and am using PIC16F688 as a default PIC as I have plenty of them I want to test out using C.
I have written a dummy delay routine to see whether it will compile and run using MPLAB 8.80 SIM:
#include <htc.h>
void main(void)
{
unsigned char DLY5N;
unsigned char a,b,c,i;
DLY5N = 100;
a = 0;
b = 2;
c = 0;
for (i=1; i=DLY5N; i++)
{NOP();}
a = b + c + 1;
LOOP:
goto LOOP;
}
The compiler states _a and _i not used ???? and the disassembly listing shows some very weird results and the program will not step past the "for" statement.
Any help to get off the first very basic steps will be appreciated.
I have downloaded PICC 9.83 and am using PIC16F688 as a default PIC as I have plenty of them I want to test out using C.
I have written a dummy delay routine to see whether it will compile and run using MPLAB 8.80 SIM:
#include <htc.h>
void main(void)
{
unsigned char DLY5N;
unsigned char a,b,c,i;
DLY5N = 100;
a = 0;
b = 2;
c = 0;
for (i=1; i=DLY5N; i++)
{NOP();}
a = b + c + 1;
LOOP:
goto LOOP;
}
The compiler states _a and _i not used ???? and the disassembly listing shows some very weird results and the program will not step past the "for" statement.
Any help to get off the first very basic steps will be appreciated.