PASM Question WRLUT
Christof Eb.
Posts: 1,197
Hi
working with the TIA assembler for P2. I originally had:
mov r3,#1 wrlut r3,#tosetL ret
Which did not work. (I want to write the contents of r3 into the lut at the position that is defined by the constant tosetL.)
Finally this works as intended:
mov r2,#tosetL mov r3,#1 wrlut r3,r2 ret
Is this just a limitation/bug of the assembler or have I missed something about wrlut?
Thanks!
Comments
For WRLUT and similar instructions (RD/WR-LUT/BYTE/WORD/LONG) you can only use #Address in the range 0..255, if bit 8 of the Address is set it's encoded as PTRA/PTRB addressing with indexing or auto increment/decrement.
Andy
RDLUT and WRLUT immediate addresses must be $000-$0FF.
Oh, thank you!
The address was indeed 511dez.
For the assembler instructions I only have the table.
https://docs.google.com/spreadsheets/d/1_vJk-Ad569UMwgXTKTdfJkHYHpc1rZwxB-DcIiAZNdk/edit#gid=0
Where do I find such information?
The encoding for the PTRx addressing with indexing is described in the Rev B_C_Silicon PDF, but only for Hub access. There is only a little hint in the progress list at the begin of the document: "RDLUT/WRLUTcan now handle PTRx expressions.", that the same is used for RDLUT / WRLUT.
The forum for sure has all the information
https://forums.parallax.com/discussion/169243/rdlut-wrlut-with-auto-incrementing-address/p1
Andy
Thank you, Ariba!