Skip to main content
Visitor II
May 9, 2003
Question

ST7 assembler variables

  • May 9, 2003
  • 2 replies
  • 778 views
Posted on May 09, 2003 at 12:20

ST7 assembler variables

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 2, 2003
    Posted on May 02, 2003 at 11:45

    Hello,

    In ROM I have declared an array somewhere:

    .LED DC.B $A6,$FF,$01,...

    Instead of using:

    clr Y

    ld A,(LED,Y)

    I want to use

    ld A,(var,Y)

    So I want to copy the adress of LED into a 16bit variable.

    How can I do that + declare that variable?

    tia!

    Christophe
    Visitor II
    May 9, 2003
    Posted on May 09, 2003 at 12:20

    I'm not sure to understand what you wanna do...

    If LED is declared in ROM (and that's the case apparently), you won't be able to midify its content. If you want to access some elements of this table, you can do it directly: ld A,(LED,X) or if you want to get the address of LED:

    .LED DC.B $AA,$BB,$CC

    .ptr DC.B LED

    PTR will contain LED address.

    When doubting, do not hesitate to use the simulator and to try different syntaxes!