MPLAB comes with MPASM, but some guides I've seen on the internet use C18 or XC8 toolchains. Is there any significant difference for beginner projects?
2) Header files. Bring up the configuration bits window, make the appropriate changes in the various options and then generate the code and copy it to a header file.
Is the above correct or am I missing something?
4) Are the header, linker and source files all I need to generate a hex file or am I missing something?
even headers are optional, but they become extremely useful once you start writing code that's large and complex enough to warrant splitting over multiple files.
Play around with header files (and compiler/ide directives, too!), because it's a powerful tool.
QuotePlay around with header files (and compiler/ide directives, too!), because it's a powerful tool.
Most of the code a compiler compiles is actually in the header files. My header file handling configure settings on PICs are over 100KB for XC8.
The code that actually compiles to instructions in flash goes in the C file.

Compiler warnings are one of the most impordant tools you have in your ide. Learn how to trigger warning messages intentionally to give yourself bookmarks. Warning messages will take you to specific places anywhere in your code when u click on the warning. Vs jumping to line/label, where you can only go within one file, and you cannot jump to areas that do not generate code, such as defines and configuration and variable assignments etc, which are really directives. (Labels have a line number. So writing a label at the top of say your eeprom initilization cant take you there. If you try to open that label, the ide will take you to the next point in your code that has a line, i.e. an instruction that produces code, which could be a c9mpletsly differnt page/file. So warning messages are really useful to make.
So for instance writing a label that is indented will trigger a warning. You can use these improper labels to tag areas of interest or any experimental code. After everthing is tested and trusted, then u can fix everything to clear out the warnings.
You will not be able to fix all warnings. You will have to suppress certain ones dealing with bank bits nd paging. Those will always be generated even if done correctly.
Most of the code that's compiled is not in the header.
The code that actually compiles to instructions in flash goes in the C file.
About three days ago I did a 15 minute video on how to do a blinky with a PIC16 from components, then breadboarding, writing the program through to programming and running it with a PICkit3. This was deliberately a single continuous video clip, warts and all, from parts to finished product.
Although the ~$0.50 PIC16 I used is different, the concepts are the same. It looks like the main differences are that your device starts up with an _XTAL_FREQ of 4MHz rather than 16MHz, and that the LEDs are on TRISD/LATD rather than TRISA/LATA.
https://youtu.be/vV1hCSU5uuc
#include <xc.h>
#pragma config WDTE = OFF
#pragma config LVP = OFF
#define _XTAL_FREQ 4000000
void main(void)
{
TRISDbits.TRISD2=0;
while (1)
{
PORTDbits.RD2=1;
__delay_ms(500);
PORTDbits.RD2=0;
__delay_ms(500);
}
return;
}


The PIC16F887 device is quite old and doesn't use LATx for its output bits, it uses old school PORTx instead... which has its own complications but let's ignore that for now.
QuoteThe PIC16F887 device is quite old and doesn't use LATx for its output bits, it uses old school PORTx instead... which has its own complications but let's ignore that for now.I noticed in one of my newer PIC datasheets, it said that writing to PORTX will write to the LATX, automatically. I haven't tried this yet. Maybe I interpreted it wrong. This could save a bit of jumping around between banks.