Skip to main content
Visitor II
August 14, 2003
Question

constant declaration

  • August 14, 2003
  • 3 replies
  • 826 views
Posted on August 14, 2003 at 11:10

constant declaration

    This topic has been closed for replies.

    3 replies

    tayfunAuthor
    Visitor II
    August 14, 2003
    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

    Visitor II
    August 14, 2003
    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
    Visitor II
    August 14, 2003
    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 ]