Re: A89: Legal Crash Bug?


[Prev][Next][Index][Thread]

Re: A89: Legal Crash Bug?




 > An error in a68k most likely, which generates the wrong opcode. Multiplication
 > is always done in words, so the .w isn't necessary, and anything else (.l
 > or .b) should cause at least a warning when compiling. My guess is that a68k
 > takes the opcode for mulu #9,d7 and then adds some "standard justification
 > byte"
 > for .l, which in this case is not a good idea...

Or, maybe, it compiles the mulu.l code which is interpreted on all
CPUs above 68000/68010. The '020, '030, '040, CPU32, CPU32+ all have
mulu.l, in fact they have two versions of it:

mulu.w <ea>,dn    : 16bit x 16bit -> 32bit
mulu.l <ea>,dn    : 32bit x 32bit -> 32bit
mulu.l <ea>,dh-dl : 32bit x 32bit -> 64bit

of which only the first one is available on the 68000, 68008, 68010.

You can check if indeed this is the case, for the insn words for the 3 
different kinds are as follows,

normal 16x16->32:

1100 rrr0 11ea eaea

the long version has at least one extension word:

0100 1100 00ea eaea
0rrr 0s00 0000 0RRR

rrr is dn or dl, eaeaea is the effective address, RRR is dh and s is
the size, s=0 : 32 bit result in rrr, s=1 : 64 bit result in RRR:rrr.

In case of mulu.l #9,d7 the 4-word instruction code should be:

0x4c3c 0x7000 0x0000 0x0009

Regards,

Zoltan





References: