This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Show 16 or 32 bit variable in watch window

Dear,
In ASM I declare a 32 bit variable as follow

RSEG  MyVariables
var11:  ds 4
var12:  ds 4

In code I access each individual bytes as follow

clr  a
mov  var11+0,#0AAh  ;var11 HB
mov  var11+1,#12h
mov  var11+2,a
mov  var11+3,a      ;var11 LB

But how to show the 4 bytes as 1 variable (var11) in the watch window???
When I type "var11" it shows me only the HB, that is 0xAA and return uchar as type.
The four individual bytes would also be ok but preferably the whole variable.

These are my first steps in Keil µVision but not in 8051 assembly programming.

Thanks for any inputs... ...

Parents
  • In ASM I declare a 32 bit variable

    No, you don't. You define a 4-byte piece of data. Asm does not really have the concept of a variable, nor does it know the difference between a 32-bit integer and 4 separate bytes.

    If you want the debugger to treat this as a 32-bit integer, you'll have to talk to the debugger about it in a language that actually supports 32-bit integer variables, i.e.: C.

    The resulting construct often looks like this:

    *(uint32_t*)&var11
    

Reply
  • In ASM I declare a 32 bit variable

    No, you don't. You define a 4-byte piece of data. Asm does not really have the concept of a variable, nor does it know the difference between a 32-bit integer and 4 separate bytes.

    If you want the debugger to treat this as a 32-bit integer, you'll have to talk to the debugger about it in a language that actually supports 32-bit integer variables, i.e.: C.

    The resulting construct often looks like this:

    *(uint32_t*)&var11
    

Children