Skip navigation
1594 Views 4 Replies Latest reply: Feb 15, 2010 10:28 AM by RedPandaCurt RSS
audioartillery Just Startin' 80 posts since
Apr 18, 2008
Currently Being Moderated

Feb 14, 2010 9:17 PM

How to define a lookup table?

I've got this lookup table I'm generating.  I can't figure out how to put it in memory though.  I am trying something like this:

 

            org y:$000

 

    BUFFER  M,256
            dc #$000000 ; word 000
            dc #$00C90F ; word 001

            ...

    ENDBUF

 

But the assembler is unhappy ("ERROR --- Symbols must start with alphabetic character (Operand field)" on the dc lines).  What's the right way to define a block of memory?

 

Thanks.

  • clangen Just Startin' 25 posts since
    Jul 8, 2009
    Currently Being Moderated
    Feb 14, 2010 10:43 PM (in response to audioartillery)
    Re: How to define a lookup table?

    Hi audioatillery,

     

    a while ago we discussed the problem defining constand blocks in x: and y: memory spaces. Assembler directive DC (Define Constant) does not work, see:

     

    http://line6.com/community/thread/4643 .

     

    The problem is that during the bootload process only the program memory p: can be load. Please use the method I recommend here to fill the memory with constants during runtime.

     

    The assembler error was generated since you declared the constant after using a tap, not left aligned as it should be. Since that the dc assembly directive is interpreted as an unkown instruction.

     

    I know that filling the memory during runtime by using core instruction yields a lengthy program that doesn't fit into the p: memory space below $200 wery soon. For the moment I'm figuring out the problem described in thread http://line6.com/community/message/117946#117946 for that reason.

     

    Best regards

     

    Christian

  • RedPandaCurt Just Startin' 23 posts since
    Oct 30, 2009
    Currently Being Moderated
    Feb 15, 2010 5:49 AM (in response to audioartillery)
    Re: How to define a lookup table?

    This is similar to the thread Christian pointed to above, but what I do is put the DC's in a new P data section, below the main (p:$4E) section.  I add a DS directive in the X or Y data sections and then use a loop to copy the constants over.  That uses less code space than coding individual moves with constants if the number of constants is large.

     

    X or Y data:

     

    Foo ds 4

     

    Initialization section:

     

         move #FOO_CONSTS_0,r0

         move #Foo,r1

         do #4,_init_foo_done

         move p:(r0)+,x0

         nop

         move x0,x:(r1)+

    _init_foo_done

     

    Constant P data section:

     

    section P_DATA_MEMORY global


    org p:


    FOO_CONSTS_0    dc      $056358

    FOO_CONSTS_1    dc      $352324

    FOO_CONSTS_2    dc      $fe83a3

    FOO_CONSTS_3    dc      $98bc23


    endsec

        
         -curt

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 5 points
  • Helpful Answers - 3 points