SUBX bug
Seairth
Posts: 2,474
Peter Jakacki wrote: »BTW, I found a bug with SUBX too, is there one place where we can report these bugs or observations.
I found the (possibly same) bug as well. SUBX seems to be ignoring C.
Here's my test code:
dat org or dirb, #$FF mov t1hi, #2 ' 64-bit number: $0000000200000005 mov t1lo, #5 mov t2hi, #1 ' 64-bit number: $0000000100000006 mov t2lo, #6 sub t1lo, t2lo wc ' -> $FFFFFFFF, C -> 1 setbc outb, #0 subx t1hi, t2hi ' -> $00000001 (should be $0000000) cmp t1hi, #0 wz setbz outb, #1 loop jmp #loop t1hi long 0 t1lo long 0 t2hi long 0 t2lo long 0
GRN1 should be lighting up, since (2-(1+C)) should be zero. If you change t1hi to #1, then it lights up.
Note: ADDX seems to be fine. I have not yet tested SUBSX or ADDSX.
Edit: changed the code to explicitly test t1hi, since Z is dependent on the prior value of Z for SUBX. Bug still exists.
Comments
Yes, it works for all three examples in the P1 truth table.
The > operator in Tachyon uses this and I also confirmed correct operation