EASy68Khttp://www.easy68k.com/EASy68Kforum/ ADDX -(A0),-(A0)http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=8&t=1092 Page 1 of 1

 Author: profkelly [ Thu Apr 05, 2012 1:20 pm ] Post subject: ADDX -(A0),-(A0) The addressing mode is not behaving correctly. The pre-decrement should be progressive.Pre: A0 is \$1002\$1000: 01 02 00Post: A0 should be \$1000\$1000: 03 02 00

 Author: clive [ Thu Apr 05, 2012 2:00 pm ] Post subject: Seems to impact ADDX.W and ADDX.L also, but not a similar MOVE.WADDX is one of the few logic operations that permits EA, EA addressing.I guess CMPM, ABCD, SBCD, SUBX would be worth a look also...SUBX failsABCD failsSBCD failsCMPM only has (Ax)+, (Ax)+ behaviour, need to check if (A0)+,(A0)+ operates as expectedCMPM.B (A0)+,(A0)+ advances A0 by two, but seems to set Z when the subsequent values are not the same, using A0 and A1 to point to A0+1 does not set Z. Need to check on real silicon, but this appears to be wrong.CMPM fails

 Author: clive [ Thu Apr 05, 2012 7:04 pm ] Post subject: Here's a fix for CMPMCode:int   CMPM(){long   size;int   Rx, Ry;if (decode_size(&size))  return (BAD_INST);Rx = a_reg((inst >> 9) & 0x07);Ry = a_reg(inst & 0x07);mem_req ( (int) A[Ry], size, &source);if (size == BYTE_MASK)   A[Ry]++;else if (size == WORD_MASK)   A[Ry] += 2;else if (size == LONG_MASK)   A[Ry] += 4;mem_req ( (int) A[Rx], size, &dest);if (size == BYTE_MASK)   A[Rx]++;else if (size == WORD_MASK)   A[Rx] += 2;else if (size == LONG_MASK)   A[Rx] += 4;put (&result, dest - source, size);/* now set the condition codes according to the result */cc_update (N_A, GEN, GEN, CASE_2, CASE_6, source, dest, result, size, 0);inc_cyc ( (size == LONG_MASK) ? 20 : 12);return SUCCESS;}