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... ...
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
Thanks for the reply! Where am I suppose to use this constructor? For sure not in the “Name” column of the watch window because whatever syntax I use I always get “<cannot evaluate>” in the value column. Is the first asterix supposed to be outside the round bracket? Anyway, I tried inside outside with without …. …. always “<cannot evaluate>” in the value column. So if you could tell me a bit more how to use this constructor, that would be nice!! Regards