[gen] Generator 68000 emu bugs...

James Ponder james at squish.net
Sun Feb 22 23:21:15 GMT 2004

Ray (Lisa em) recently emailed me about this.  I'd forgotten you'd emailed
and I had not got around to checking your comments.  I now have, and umm.
Yes.  You appear to be correct on all counts.  Whoops.

Thanks :)

Point 1 - Yes... Could do with some '& 1's and brackets in there, too.

Point 2 - Just to clarify - the bug here is that when the high bit is set,
and the number of bits to shift by (anded by 63) exceeds the bit size of the
variable, Generator limits the shift to bits-1 creating a result of 1, when
it should be 0.  Correct?

Point 3 - This is because of Point 1, yeah?

Point 4 - well spotted.

Best wishes, James
James Ponder

----- Original Message ----- 
From: "Mathias Roslund" <amidog at amidog.comTo: "Generator development list" <gen at squish.netSent: Saturday, December 13, 2003 9:27 PM
Subject: [gen] Generator 68000 emu bugs...

> Hello!
> I think I've found a couple of 68000 emu bugs.
> 1. ASR: (flag calculation) It checks if "srcdata" is zero, should be
> I think.
> 2. LSR: Does of some reason compare the shiftcount with the operation bits
> (8, 16, 32) and limit the shift to operation bits - 1. This is not
> according to the manual as far as I can tell, and atleast my 68040 does
> behave this way (I've made some tests). I know some 32bit CPU's limit the
> shiftcount to 5 bits while the PPC (and 68k as far as I can tell) does use
> 6 bits making it possible to completely clear a register (or fill it with
> sign bits). The flags are calculated correctly though.
> 3. ASR: Does the same as LSR but doesn't produce an error in the result
> since it's a signed shift, but flags C and X will be wrong.
> 4. ASL: (flag calculation) When count is zero, VFLAG should be cleared as
> far as I can tell (haven't verified it on real hardware), currently it's
> unaffected. When count >= bits, VFLAG is set if dstdata is zero
> I believe it should be the other way around (dstdata != 0) since VFLAG
> should be set when MSB changes at any time, which it does if any of the
> is non-zero, i.e. dstdata != 0.
> I'm a bit tired when writing this, so I hope I've not messed anything up.
> Feel free to correct me if I'm wrong.
> Best regards,
> Mathias Roslund
> _______________________________________________
> gen mailing list
> gen at squish.net> http://www.squish.net/mailman/listinfo/gen

More information about the gen mailing list