EASy68K  
It is currently Fri Jul 21, 2017 10:48 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri May 01, 2015 2:54 pm 
Offline

Joined: Fri May 01, 2015 9:50 am
Posts: 1
I think I've come across a bug in 5.15.02 (If I'm reading my Motorola 68000 PRM correctly) when ROR is used in an admittedly strange way.
Code:
moveq  #$FF,d0
ror.b  d0, d0
rol.b  d0, d0


The C flag is NOT set after the ROR, but it IS set after the ROL. From my reading of the docs, the ROR should be setting the C flag too.

According to the PRM on page 4-161 "(C is ) set according to the last bit rotated out of the operand; cleared when the rotate count is zero". Also, later on on the same page "Bits rotated out of the low-order bit go to the carry bit and also back into the high-order bit.""

The rotate count is $FFFFFFFF % 64 which is 63 so the "cleared when the rotate count is 0" exception doesn't apply. All bits in the operand are 1 so the last bit out of the operand can never be 0 and hence C can never be 0 either. Am I missing something obvious here? Thanks!


Top
 Profile  
 
PostPosted: Tue May 05, 2015 2:05 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1039
Confirmed. I'll take a look at the code.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Thu May 21, 2015 3:42 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1039
Corrected in EASy68K V5.15.03 May-21-2015

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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:  
Powered by phpBB® Forum Software © phpBB Group