EASy68K  
It is currently Sat Oct 21, 2017 2:51 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Mar 13, 2013 4:01 pm 
Offline

Joined: Sun Feb 17, 2013 7:16 pm
Posts: 10
MOVE.L #$ce3dd567, D0
MOVE.L #20, D1
MOVE #0, CCR
ROL.W D1, D0

The carry flag should be set after rol instruction above (confirmed on real 68020) but it's set with a shift count of 4 only in EASy68K.
If I understand that right a shift count of 20 generate the same result like a shift count of 4 by word size operation.
Sure there should be no reason to use a shift count higher than operation size, because of higher cycle consumption.


Top
 Profile  
 
PostPosted: Thu Mar 14, 2013 6:44 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1048
Thank you for the feedback.

The code that calculates the Carry flag for ROL in EASy68K was incorrect.
Here is the latest code in Sim68K v5.12.27:
Code:
      r %= (m+1);               // shift count MOD size
      if(r == 0)
        c_bit = (dest & 1) ? true : false;
      else
        c_bit = ((dest >> (m+1-r)) & 1) ? true : false;
r is the shift count, m is 7 for .B, 15 for .W and 31 for .L instruction size.
c_bit is set to 0 elsewhere if r is 0.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group