
TO WORD WRAP THIS TEXT:

Click Edit on this screen's above toolbar and then click on Word Wrap.

TK3 PIC DISASSEMBLY NOTES - 22FEB03, updated 19JUN04

Some of this information may update that given in the published EPE TK3 text.

Always check the Updates file for any information that affects these notes. It is normally issued whenever an update to TK3 is released and is accessible via the "Latest Updates" button at the bottom of the main TK3 screen.


Before any attempt at communication with the PIC is made from any function button, and if the Verifying option is in use (see Verifying notes viewable via the Check PCB button on the main screen), a check is made to determine if the printer port cable is connected and the PCB power is on. A message box appears if either of these conditions is false.

DISASSEMBLY TO ASM SOURCE CODE

The program data contents of a PIC may be read back and restructured to a source code equivalent, formatted for MPASM grammar (see the Assembly and Conversion notes). Since the intentions of the original source code designer can never be known, correctly named labels and equates cannot be regenerated. They are simply given reference codes in relation to the registers and jump/call addresses, as numerical values having the prefixes of REG and JMP. 

It is up to the user to interpret the designer's intentions. No guidance can be offered on this.

Since 19Jun04 this routine also reads back Data Eeprom and Config data.

DISASSEMBLY TO HEX

The disassembly to HEX files seems self-evident. Please advise if you think it needs explaining.

The HEX files can be converted to OBJ via another button. When you view the OBJ data through the associated screen button, it is a decimalised version of the binary data you are examining, since binary data cannot be correctly viewed via a text editor. This decimalised data is not intended for editing or PIC programming use.

It is recommended that you no longer think of using OBJ files, they are a "hang-over" from EPE's first PIC programmer days when TASM was the only programming dialect available via EPE, and which generated OBJ files. TK3 now places the emphasis on HEX files that are compatible with Microchip's MPASM structure.

PIC SIZE SETTING

Disassembly is always according to specified program data capacity for the PIC in question. There is no way in which the disassembler can know at which point the usable program code ends and where "garbage" begins. Only intelligent inspection of disassembled files can reveal this.

It is necessary to specify the PIC type being disassembled so that the disassembly knows when to cease data read back. If, for example, a PIC16F84, having 1024 program data memory locations, is read back as though it were a PIC16F877, the disassembler would read back data 8192 times, eight-times the capacity of the '84. This would result in the same PIC memory locations being read eight times, since the PIC16F84's internal address counter rolls over to zero after location 1024.

Conversly, reading back from a PIC16F877 when the disassembler is set for the size of an '84, will result in only one-eighth of the data being retrieved.

However, if you believe that the usable data within the PIC is less than its stated capacity, a smaller size value can be set (see the Select PIC Size notes).

Disassembly always starts from PIC address location zero.

ADDING YOUR OWN NOTES

These notes are displayed via an "Active" text editor and you may add your own notes to them, saving them to disk in the usual way.
