-CLst2Asm- CCS C Compiler Listing File to Assembly Language Converter v 1.01 (c) 2002, Noetic Design, Inc. README Intro ----- This utility makes up for a big missing feature in the CCS C compiler (PCM) for PIC microcontrollers -- it does not give you the intermediate PIC assembly language, only a listing file and a hex file. This makes it hard to change the startup code so that Rick Farmer's PICLOADER 1.1 can load a program written in CCS C. One solution is a modified version of Rick's PICLOADER, version 1.3, that is compatible with CCS C's reset vector implementation. The problem with this scheme is that this limits one to running just CCS programs, and not those of other languages. That lead to the development of the "PICLoader Reloader" programs which allow one to switch between bootloaders using a serial cable and not an expensive PIC programmer. CLst2Asm is a different solution to the same problem. It takes the .lst file output by the compiler, parses it, and converts it to valid assembly language compatible with Microchip's MPLAB. (/b) It can optionally fix up the reset vector so that Rick's loader 1.1 can load the file. This adds some steps to the CCS C develop- ment cycle (compile -> convert -> assemble -> upload, instead of compile ->upload), but the advantage is that one can also upload JAL or CH Basic programs. Interrupt handlers (org 4) are left alone and work fine. It has an experimental feature (/r) that converts absolute goto and call addresses to relative symbols, but does not work if the program is larger than one page of PIC program memory. This is useful if you don't mind doing some massaging of the assembler output, in the case that the reset handler is outside of page 0 and that you have an interrupt handler. When combined with /b, a program that has an interupt handler will get two "traps" inserted which are located at location 3 (Rick's bootloader's reset vector) and location 4. The original reset code from locations 0-3 is moved to location 5; location 3 jumps to it. Location 4 contains a jump to location 8 where the original interrupt handler has been symbolically relocated. Command Line ------------ CLst2Asm v. 1.01 CLst2Asm, (c) 2002 Noetic Design, Inc. Command Line Help: CLst2Asm /b /r /v /q /h infile.lst outfile.asm Example: C:\>CLst2Asm /r cloader.lst cloader.asm /b - fixup for Rick Farmer's PICLOADER serial bootloader /r - replace absolute numeric goto and call addresses with symbolic labels /v - verbose /q - quiet /h - this help text infile.lst - the file to convert to asm outfile.asm - the resultant file All parameters are optional; empty outfile.asm dumps output to stdout; no infile .lst means input from stdin. Input File = stdin Output File = stdout Exiting. Version History --------------- v1.01 - 4/26/2002 ----------------- Fixes: - updated to work with CCS C 3.085 as well as 2.734. You must set the listing format in CCS C to "simple", which is the default. This is set using the menu Options -> File Formats to pull up the File Formats dialog, then in the List Format area click on Simple. Bugs: - /r still does not work if the code is larger than one page of program memory. v1.0 - Initial Release ---------------------- Bugs - This utility is designed to work with the compiler output listing file generated by CCS C version 2.734. It may work with 3.x, but I haven't received my upgrade yet. License ------- Free for private use. Contact Noetic Design, Inc. for licensing by corporate users: license@noeticdesign.com www.noeticdesign.com/robotics/