Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
|
I'm using Metrowerks and the CodeWarrior debugger for an HC12. It is HiWave ver 6.1 from MW Ver 1.2 (I'm chicken about installing the new tryout version 2.0). I have a ram location that I declare as "extern volatile unsigned int" in MW. In the debugger Data1 window, I can see it listed as an array of two unsigned characters. In the Data2 window, I can add the expression and it shows the address of the ram location, with no mention of the value stored therein. Anyone know how I can get to see the value of variable as an int in the debugger? <Digression> Variables defined by "RMB 1" (unsigned char) show in the Data2 window by showing their value, not their address as do ints. This does make the debugger data windows confusing. Assembly-only int variables declared as "RMB 2" also show as two unsigned chars. That could be a clue, I suppose. I don't see any assembler directive for reserving space for a word, though. Just RMB aka DS. </Digression> Sure, I can live with it, but I'm hoping that there is a way to make it nicer to live with. Thanks, Bob White |
|
|
|
Hello Bob, The assembler itself does not know about normal/standard C types. But have a look to the DS directive: by default it is .B (byte), but you have .W (word as well). instead of bob: RMB 2 use bob: DS.W 1 below extract from the manual/online help. Erich -------------------- DS - Define Space Syntax: [<label>:] DS [.<size>] <count> where <size> = B (default), W or L. Synonym: RMB (= DS.B) Description The DS directive is used to reserve memory for variables. The content of the memory reserved is not initialized. The length of the block is <size> * <count>. <count> may not contain undefined, forward, or external references. It may range from 1 to 4096. Example Counter: DS.B 2 ; 2 continuous bytes in memory DS.B 2 ; 2 continuous bytes in memory ; can only be accessed trough the label Counter DS.W 5 ; 5 continuous words in memory The label `Counter' references the lowest address of the defined storage area. > -----Original Message----- > From: Bob White [mailto:] > Sent: Samstag, 5. April 2003 00:06 > To: > Subject: [68HC12] MW debugger - int > I'm using Metrowerks and the CodeWarrior debugger for an HC12. > It is HiWave > ver 6.1 from MW Ver 1.2 (I'm chicken about installing the new > tryout version > 2.0). > > I have a ram location that I declare as "extern volatile unsigned int" in > MW. In the debugger Data1 window, I can see it listed as an array of two > unsigned characters. In the Data2 window, I can add the expression and it > shows the address of the ram location, with no mention of the value stored > therein. Anyone know how I can get to see the value of variable as an int > in the debugger? > > <Digression> > Variables defined by "RMB 1" (unsigned char) show in the Data2 window by > showing their value, not their address as do ints. This does make the > debugger data windows confusing. > > Assembly-only int variables declared as "RMB 2" also show as two unsigned > chars. That could be a clue, I suppose. I don't see any assembler > directive for reserving space for a word, though. Just RMB aka DS. > </Digression> > > Sure, I can live with it, but I'm hoping that there is a way to make it > nicer to live with. > > Thanks, > Bob White > > > -------------------------------------------------------- > To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit > http://www.motorola.com/mcu |