cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax Question in Assembly

rvalascho
Associate II
Posted on September 02, 2003 at 15:41

Syntax Question in Assembly

4 REPLIES 4
rvalascho
Associate II
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???
rvalascho
Associate II
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
sjo
Associate II
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
rvalascho
Associate II
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