AnsweredAssumed Answered

Metrowerks HC(SX)12 assembler and Code Warrior debugger

Question asked by coste alain on Feb 2, 2008
Latest reply on Feb 5, 2008 by bigmac
I have some trouble in setting the options of the macro assembler to make debugging as comfortable as possible:
First Problem: my assembly code relies heavily on macros and conditionnal assembly, and this is bad for the .dbg files used by the debugger:
   -  if I choose the option "print macro expansion in listing files", the .dbg files are invaded with the "else" and "endif" of the branches not taken by the conditionnal assembly (and when you have to skip several pages of such lines to see the next instruction debugging becomes tedious).
   - if I choose the option "dont print macro expansion", dbg files are much more readable, but it becomes impossible to see the stepping of the instructions of the macro in the source window (well, I can see the instructions in the disassembler window, but without comments and making up it is often difficult to understand what happens).
   - the solution would be to have a dbg file with ALL the microcontroller instructions genererated by the macro assembler, and ONLY the instructions. Does somebody know a way to get this ?
Second problem: labels generated by the assembler; I have many arrays declared like this:
ARRxxx:     dc.W $FF45, $EA56, ....
                   dc.W ............
                   dc.W ...............
In my view, all the values belong to the "array" ARRxxx, but the assembler only associates the first line to the label ARRxxx, the second and third lines are associated to labels like VAR000025,VAR00026, etc... Now, when debugging a routine which uses register X as pointer to the array, you drag X from register to data window, and you get the information : "VAR00026+3", but what is VAR00026 ? (ARRxxx+7 would be much more interesting).
Naturally, it is possible to declare all the array with a unique dc.W, but if the array is large, you must put all the values on the same line, making things unreadable (and you can no longer mix dc.W and dc.B in the same array).
The problem does not exist in code sections, where the assembler only uses user labels and doesn't generate its labels.
Do you know a way to reqire the assembler to use only MY labels ?
Sorry for the length of my questions, and for my bad english...........

Message Edited by electro on 2008-02-02 09:58 PM