EASy68K
http://easy68k.com/EASy68Kforum/

Possible asl.l Simulator (v5.12.3) Issue
http://easy68k.com/EASy68Kforum/viewtopic.php?f=8&t=1111
Page 1 of 1

Author:  aboxer [ Tue May 15, 2012 5:30 pm ]
Post subject:  Possible asl.l Simulator (v5.12.3) Issue

I am using the latest simulator (v5.12.3) starting with X=0 and C=0.
The following snip of code results in X=1 and C=1.

move.l #$fffffff8,d2
move.l #$ffffff99,d5
asl.l d2,d5

The 68000 spec says d2 will be treated as a modulo 64 number which is
56 decimal. That is large enough to make the last shifts into X and C equal
zero.

thanks,
aaron boxer

Author:  profkelly [ Wed May 16, 2012 4:10 pm ]
Post subject: 

Corrected in Sim68K v5.12.5
Changes: UTILS.CPP, cc_update function,
Code:
    case CASE_9 :                   // ASL, LSL CK 5-2012
                if (r > m+1)        // if shift count > size
                    c_bit = false;
                else {
                    r %= (m+2);
                    c_bit = ((dest >> (m-r+1)) & 1) ? true : false;
                }
                break;

Also changed the call to cc_update in CODE7.CPP for ASL & LSL.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/