I want to use a lookup table, which is situated in the cog memory (to be as fast as possible).
I'm using propgcc and I am not able to declare an array as a _COGMEM.
Is this possible in propgcc? Is it possible at all (with assembler)?
A lot depends on what you want to do with the data, but in assembler (psam) it is certainly possible. I can't help with propgcc. The value to read comes from a mov instruction..
rdval mov value, 0-0
where the 0-0 is a placeholder for the source address. That source address gets put there by a movs instruction somewhere else in the code...
movs rdval, my9bitSourceAddress
That is, self-modifying code. It might be part of a loop that steps through values of my9bitSourceAddress, or my9bitSourceAddress might come from a command of some sort. Here is a helpful snippet from JonnyMac.
Just FYI... One way to make it as fast as possible is to start your table at memory location #0 (I.e, the bottom of cog ram).
It's a bit of a trick, but then you don't need to add in the offset to the table...
Comments
thank you for the reply!
It's a bit of a trick, but then you don't need to add in the offset to the table...
Does anyone knows why we can't do this in propgcc?
Tricks like the one above would probably require doing this...