Skip to main content
Visitor II
September 2, 2003
Question

Syntax Question in Assembly

  • September 2, 2003
  • 4 replies
  • 739 views
Posted on September 02, 2003 at 15:41

Syntax Question in Assembly

    This topic has been closed for replies.

    4 replies

    rvalaschoAuthor
    Visitor II
    August 27, 2003
    Posted on August 27, 2003 at 19:50

    ld A,TimerA_freq1 ;PWM frequency

    ld TimerA_freq,A

    ld A,{TimerA_freq1+1}

    ld {TimerA_freq+1},A

    what does the TimerA_freq1+1 stand for. At first I thought it was simple addition, but now I'm thinking it's some type of indexing???
    rvalaschoAuthor
    Visitor II
    August 28, 2003
    Posted on August 28, 2003 at 18:20

    I guess ot clarify my question, what does

    (any variable)+1 mean when it is used like

    ld (any variable)+1, A
    Visitor II
    August 29, 2003
    Posted on August 29, 2003 at 07:28

    It is used to access the memory location + offset eg.

    ld A, var ; var address 0x80 in ram (high byte of word)

    ld A, {var+1} ; read adr 0x81 (low byte of word)

    if var is declared as a 16bit word.

    Hope this helps

    SJO
    rvalaschoAuthor
    Visitor II
    September 2, 2003
    Posted on September 02, 2003 at 15:41

    Quote:

    On 2003-08-29 10:58, sjo wrote:

    It is used to access the memory location + offset eg.

    ld A, var ; var address 0x80 in ram (high byte of word)

    ld A, {var+1} ; read adr 0x81 (low byte of word)

    if var is declared as a 16bit word.

    Hope this helps

    SJO