RoboScout Internals: Trails: Microcontrollers:

Disassembly Notes

Disassembling the microcontroller code required some manipulation. First problem was that the hex file from Warp 13 appeared to be in INHX32 format. The disassembler didn't like that. The example hex files for the disassembler seem to be in INHX8M format, so I converted the Warp 13 file by deleting all the control lines. I also deleted all the unprogrammed lines at the end to create a smaller file.

Second problem was that the first program word in my hex file for Microcontroller C is 8A81 (LSB-MSB format). This can't be an instruction, since the pic's program counter is only 14 bits wide. I don't know what it is, possibly the configuration word? The remaining program words were all valid, however, so I zeroed out this word in the hex code for all three microcontrollers to create a NOP as the first instruction.

Third, the disassembler had problems with certain line references. The lines are all labelled as A0###, where ### is the line number. GOTO and CALL instructions reference these labels. That's all fine. But some instructions came out like this: GOTO A0-8##. For a while, I thought this problem happened only with one label pattern, and I used a "Replace All" to get a syntactically-correct source file. I've since discovered, however, that the problem occurs whenever the destination is any label above A01FF. To fix it, I wrote a simple postprocessor program that looks for this problem, pulls out the hex for the opcode, disassembles that one instruction, and inserts it into the assembly-language file.

Useful Links:

< Prev   



| Home | RoboScout Internals |