Looking for assembly example
I'm preparing to teach a course using a PIC18F microcontroller this Fall. While the emphasis is on C programming, we do touch on assembly language. So, I'm looking for an example in assembly language. I've found many examples for assemblers other than pic-as, which is provided with xc8.
I have questions near the end.
In the document, "MPLAB XC8 PIC Assembler User's Guide for Embedded Engineers," The following is an account of my work with the example in section 3.
Despite what's said, it's not clear how to use MPLAB X to assist with code to set the configuration bits. I briefly set the build to use xc8, then used the Set Configuration Bits window to produce C code, which I inserted and edited. The editor text replace did quick work to remove the leading text "#pragma" and change " = " to "=". Then I changed the build back to pic-as. Maybe I missed something, is there an easier way?
While the given example builds and loads, in looking at the target program memory, at address $00000 there was no goto statement, to direct the program start. After digging in the assembler user guide I found that the PSECT switch "abs" can work with the ORG directive. Okay, now I see a goto at address $00000.
PSECT resetVec, class="CODE", abs
Next, the debugger is reporting that:
Break point at line 72 in file J:/Courses/Tools/Microchip/Asm03/Asm03.X/main.asm cannot be resolved to a valid program memory address
(1) Is the resetVec section given above correct? Perhaps there is something more correct?
(2) Anyone know why the debugger is failing? Perhaps debug symbols should be enabled somehow?
(3) Maybe there is an easier way to produce configuration records for assembly language?
Thanks in advance,