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
  • 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.

Reply
  • 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.

Children
No data