Possible bug with AUGS followed by ALTS
Cluso99
Posts: 18,069
in Propeller 2
Here is the suspect code...
y is an index into the table
When y + _TABLE_OPC0 causes an overflow from >$1FF, the overflow is lost.
Here is a sample output where the first hex is the value of "y", the second hex is the hub location of "_TABLE_OPC0", and the third hex is the resultant (sum) "p" value.
The attached file uses my LMM Serial Debugger code for display purposes on the serial P30/31 port at 115200 baud.
alts y, ##_TABLE_OPC0 '\ set next S to offset+table addrs mov p, #0-0 '/_TABLE_OPC0 is a table located in hub ram
y is an index into the table
When y + _TABLE_OPC0 causes an overflow from >$1FF, the overflow is lost.
Here is a sample output where the first hex is the value of "y", the second hex is the hub location of "_TABLE_OPC0", and the third hex is the resultant (sum) "p" value.
=== Cluso's P2v10a Debugger v.105x === 000000C0+00001508=000015C8 MIN 000000C8+00001508=000015D0 MAX 000000D0+00001508=000015D8 MINS 000000D8+00001508=000015E0 MAXS 000000E0+00001508=000015E8 SUMC 000000E8+00001508=000015F0 SUMNC 000000F0+00001508=000015F8 SUMZ 000000F8+00001508=00001400 00000100+00001508=00001408 00000108+00001508=00001410 00000110+00001508=00001418Note that when $F8 is added to $1508 the result should be $1600 but is shown as $1400 (ie the $200 carry is lost). It seems that the addition is limiting the size of the addition to 9 bits.
The attached file uses my LMM Serial Debugger code for display purposes on the serial P30/31 port at 115200 baud.
zip
11K
Comments
The MOV instruction only has a single '#' immediate symbol so will always be limited to 9 bits unless it also has its own AUGS preceeding it.
What seems to be happening is the AUGS is also being applied to the MOV instruction too.
I actually added a section to the doc file on this. I'm going to go add in the ALTI description now.
I can use this sequence instead... Here is where I use the sequence to decode the condition bits to an "if_xxx" string I have tables in hub for the various conditions, opcode sets, etc, for decoding instructions in my Lmm Serial Debugger.