Ways to read data tables in asm
tonyp12
Posts: 1,951
Self modifying code is a must as prop does not have registers.
This is something I put togheter quickly,
the good part is you can add to the data list
without counting how much data there is.
It loops through the table forever.
What is your prefered way to do it?
This is something I put togheter quickly,
the good part is you can add to the data list
without counting how much data there is.
It loops through the table forever.
What is your prefered way to do it?
movd :loop,datapnt 'change d-field below at location :loop add datapnt,#1 'add one long for next time cmp datapnt,#datapnt wz 'did it reach the end? if_z mov datapnt,#data 'if soo, reset data pointer :loop test 0-0,asm_bit wz '0-0 is were selfmod code goes. ... ... data long %00000000_10100000_10101000_00101010 long %00000000_10101000_10101000_10101010 long %00000000_10101000_10001000_10101010 long %00000000_10101000_00000000_10101010 datapnt long data
Comments
The propeller has more registers than any other microcontroller I know. It has 512 registers also called COG RAM. What makes RAM a register? The fact that it can be used by the processors ALU for it's operations.
What's missing in the propeller is an indirect addressing mode.
I would be good if you could use something like this.
:loop test (datapnt)+, asm_bit wz ' test the data that the datapnt is pointing at, post add 1 to datapnt.
But the prop have a very clean instruction set,
and the selfmode code is not that bad when everything else is such a joy.
lenght counter and djnz i wanted to avoid, as the table is animation data that will loop forever.