2006-03-13 10:15 PM
2006-03-13 07:50 PM
Hi all, and thanks for reading this post,
I'm looking for a syntax example for a 256 value look up table in ST7 assembler. Has someone ever done this ? Thanks in advance for your help Akotronic2006-03-13 09:51 PM
Akotronic,
the ASM lookup table implementation depends on the size of each element. As an example, here is the code that computes a power of 2. ; This is the lookup table PowersOf2 BYTE $01,$02,$04,$08,$10,$20,$40,$80 ; This is the code to access the lookup table ; NOTICE: X holds the exponent e.g. X=3 means 2^3 LD A,(PowersOf2,X) If each element needs more bytes (I mean more than one), you have to split the data in more tables - the quickiest way for the ST7 - or do some address computation. BTW, see the output file of a C assembler that implements a lookup table, you'll find some interesting hints... Bye EtaPhi2006-03-13 10:15 PM
Hi EtaPhi and others,
In my case, I need only one byte for each element, so your exampe is ok for me. Thanks very much for your answer. Akotronic