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

uVision2 debugger

In A51 the next definitions takes two cells of RAM, (0AH), for example, and (0BH):

data_variable: DS 1
typeless_number EQU 0BH

and can be treated with the same instruction:

MOV A,data_variable (F50A)
MOV A,typeless_number (F50B)

,but there is the value of "data_variable" displays properly in the "Watch" window,
"typeless_number" shows it's address instead
of the value.

How can I trace such a variable?

Parents
  • friends,

    come back to the original question:

    data_variable: DS 1
    typeless_number EQU 0BH

    and can be treated with the same instruction:

    MOV A,data_variable (F50A)
    MOV A,typeless_number (F50B)

    ,but there is the value of "data_variable" displays properly in the "Watch" window,
    "typeless_number" shows it's address instead
    of the value.

    How can I trace such a variable?


    I think the question is not in difference between EQU/define/DATA et cetera, the matter is "how to obtain this value". And the answer is simple - follow the [simple] rules which Keil made for us. Debugger (and its Watch module) is not so smart to understand that if user types "EQU" then he orders: "look at the value which is stored in a memory which address in indicated by this fancy number". So open datasheet, read about numbers and addresses and have good sleep then.

    Regards,
    Oleg

Reply
  • friends,

    come back to the original question:

    data_variable: DS 1
    typeless_number EQU 0BH

    and can be treated with the same instruction:

    MOV A,data_variable (F50A)
    MOV A,typeless_number (F50B)

    ,but there is the value of "data_variable" displays properly in the "Watch" window,
    "typeless_number" shows it's address instead
    of the value.

    How can I trace such a variable?


    I think the question is not in difference between EQU/define/DATA et cetera, the matter is "how to obtain this value". And the answer is simple - follow the [simple] rules which Keil made for us. Debugger (and its Watch module) is not so smart to understand that if user types "EQU" then he orders: "look at the value which is stored in a memory which address in indicated by this fancy number". So open datasheet, read about numbers and addresses and have good sleep then.

    Regards,
    Oleg

Children
  • I think the question is not in difference between EQU/define/DATA et cetera

    But it's exactly about the difference between EQU and DS!

    And the difference between those is precisely that one generates a number, the other a variable. This difference both neatly explains the difference of behaviour if one tries to display things in the debugger (the EQU is not displayed as "its address", but actually as itself: a number), and provides an obviously correct solution to the problem: don't use EQU if what you wanted was to define a variable.

    Now, even an EQU-ed "variable" can be viewed in the debugger, but you'll have to go through quite some painful typing to get there. You'd have use something like

    *(data char *)equ_label
    as the expression whose value is to be displayed or watched.