Wish You could build a longtable with addresses of other variables. Should be able to do it as the addresses are know at compile time. What I would like to be be able to do directly is something like:
Code:
_TT1 bytetable "RR Hip Hor", 0
_TT2 bytetable "RR Hip Vert",0
_TT3 bytetable "RR Knee", 0
...
TT_TABLE longtable @_TT1, @_TT2, @_TT3, ...
...
p var POINTER
; To print out a index number
p = TT_TABLE(i)
serout s_out, i9600, [str @p20\0]
Note it would be even better if there was a pointertable... But above works.
Note: I have emulated reasonably, at the end of my defines I put in:
Code:
goto AfterTable
BEGINASMSUB
ASM{
TT_TABLE:
.long (_TT1 + 0x20000)
.long (_TT2 + 0x20000)
.long (_TT3 + 0x20000)
...
}
ENDASMSUB
AfterTable:
I put the goto and label in as the compiler put in some code stuff and it wanted to fall through to run the table as code. Also the compiler did not know what TT_TABLE was so it did not like indexing it like an array. I have assembly code to emulate an array lookup.
Code:
; Need to get to text name for servo
xor.l er0, er0 ; zero out the whole thing
mov.b @I, r0l
shal.l er0
shal.l er0 ; multiply by 4 bytes per...
mov.l #TT_TABLE:24, er1
add.l er0, er1 ; should have the address now
mov.l @er1, er0
mov.l er0, @P
Probably not a high priority, but would make table driven things work a little better.
Kurt