Ok, i found another bug (i think its also asmx source question).
asmx sees too big difference between "move.w
0(a1),d1" and "move.w
1(a1),d1".
When it's 1 or more, it gives correct code -
32 29 00 01, but when it's 0, it just gives
32 11 instead of
32 29 00 00.
How comes?
I'm trying to assemble original ROM from sources, so I found out there is a difference.
Asmx has interesting comments at 657 line -
// 0(PC,Xn) 0(An,Xn) and
// FIXME: reg1 can't be PC here?...
Code: Select all
else if (token == ',')
{ // 0(PC,Xn) 0(An,Xn)
// FIXME: reg1 can't be PC here?
val = 0;
reg2 = GetReg(DA_regs);
if (reg2 == 16) reg2 = 15; // SP -> A7
if (reg2 >= 0)
{
// get Xn forced size if any
width = WID_W;
if (linePtr[0] == '.' && toupper(linePtr[1]) == 'L')
{
linePtr = linePtr + 2;
width = WID_L;
}
else if (linePtr[0] == '.' && toupper(linePtr[1]) == 'W')
linePtr = linePtr + 2;
//CheckByte(val); // zero IS a byte
if (RParen()) return FALSE;
if (reg1 == 9)
{
// (PC,Xn)
if (!store)
{
// val = val - locPtr - 2; // don't offset from PC
ea -> mode = 0x3B;
ea -> len = 1;
ea -> extra[0] = (reg2 << 12) + (val & 0xFF);
if (width == WID_L)
ea -> extra[0] |= 0x0800;
return TRUE;
}
}
else
{
// (An,Xn)
ea -> mode = 0x30 + reg1;
ea -> len = 1;
ea -> extra[0] = (reg2 << 12) + (val & 0xFF);
if (width == WID_L)
ea -> extra[0] |= 0x0800;
return TRUE;
}
}
}