If I knew the syntax and what it meant I could find my way.
Go ahead and sigh all you want, this is a foreign language to me.
I'll try and explain the various lines,
Device = 18f1320
Pretty simple - tell the compiler which chip your using.
Clock = 4
Again, tell the compiler how fast it will run - 4MHz in this case.
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Tricky one, this is the dreaded configuration word. It tells the chip what to expect and what we want it to do. In this case we want the OSCillator to be INTernal and the 2 pins normally used for a crystal to be normal IO pins. We don't want the Watch Dog Timer or Low Voltage Programming to be enabled.
OSCCON = $62
If you check the data sheet then OSCCON CONtrols the OSCillator. In this case we want it to run at 4MHz.
TRISA=%10111110
Ahhh, the TRIS register, names because when we set a bit in it the corresponding port bit becomes an input. Set it to zero and the pins become output. When set as output we can write a 1 or 0 to the port bit and the corresponding pin will become 5V or 0V. The name tris is because the pin can have three states (input - 5V -0V) Hence TRIState.
PORTA=0
This just set's all pins that are outputs (A0 and A6) to 0V.
While (true)
This is an instruction that causes the program to go in a loop until the expression in the brackets is false. In this case the expression is always true and so it will loop forever.
Toggle(PORTA.0)
Toggle means invert. If it was 1 make it 0 and vice versa. The .0 on PORTA signifies that we want to flip the state of bit 0 of port A.
DelayMS(500)
Pretty obvious, wait 500mS.
Wend
This is how we tell the compiler where we want the while loop (see above) to end. It is a short form of While END.
End
Tells the compiler that we're done. No more code.
Well, the above makes sense to me but then I understand it. I'm sure it's gobbledygook to others but if you spend a little time it will start to make sense.
Mike.