[hatari-users] DSP emulation - MPY #immediate

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-users Archives ]


Hello,

I think I see a bug (?) in the DSP56k emulation. I'm not absolutely sure yet but I checked what I could against the DSP56001 User Manual before posting...


When assembling the 'multiply immediate 2^-n' (i.e. the n-bit right shift) instruction e.g.

  mpy x0, #4, a
  move          a0,D    ; D = (x0>>4)

  mpy x0, #(24-4), a
  move          a1,D    ; D = (x0<<4)


...Hatari issues an illegal instruction error when executing the MPY opcode. The disassembly looks like this:

p:08bb  0114d0         (00 cyc)  dc $0114d0        <--- MPY x0,#20,a
p:08bc  0af080 000902  (07 cyc)  jmp p:$0902


The encoding for this instruction can be found on page A231 of the DSP56000 Family Manual and $0114d0 seems to be the correct opcode encoding. The same opcode can be found in the DSP56001 User Manual.


There is no hurry for this but would nice to be able to use this instruction. It's the only way to shift N bits without clobbering an extra register with another move :-)

Thanks!

Doug.

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/