cancel
Showing results for 
Search instead for 
Did you mean: 

constant declaration

tayfun
Associate II
Posted on August 14, 2003 at 11:10

constant declaration

3 REPLIES 3
tayfun
Associate II
Posted on August 14, 2003 at 07:47

Hi,

When defining constant tables in Rom segment for ST72F324J6,

it maybe a chance or fault, I see that after defining

.SEGTAB1:

DC.B $FE

the read of SEGTAB1 first element results in $01.

If we define it as

.SEGTAB1:

DC.B 254 then read to it is OK.

Can you please advise it ?

Regards,

Tayfun

sjo
Associate II
Posted on August 14, 2003 at 11:07

If you are using ST assembler then you need to declare your array as:

.SEGTAB1 ; remove :

DC.B $FE,$FF

to access the array:

clr X

ld A, (SEGTAB1,X) ; read first element of array

inc X

ld A, (SEGTAB1,X) ; read second element

Hope this helps

SJO
sjo
Associate II
Posted on August 14, 2003 at 11:10

Forgot to mention make sure the memory declaration is not on the first column eg.

.SEGTAB1:

DC.B $FE,$FF

not

.SEGTAB1:

DC.B $FE,$FF

Note: Forum has removed spaces.

Regards

SJO

[ This message was edited by: sjo on 14-08-2003 14:42 ]