EASy68K  
It is currently Mon Sep 16, 2019 9:06 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: BCD Encoding Question
PostPosted: Tue Apr 03, 2012 8:41 pm 
Offline

Joined: Mon Mar 19, 2012 9:11 pm
Posts: 17
Hi,

Neither the M68000PRM, the M68000_Users_Manual nor Google shed
any light on what a BCD instruction like ABCD should do when it encounters
an illegal encoding (>9 hex). I don't see it listed as an exception anywhere.

I can see that the Easy68k simulator treats A-F like 10-15. Does anybody
know if that is the official specified behavior? Or maybe it is just the
unspecified behavior of some implementation.

thanks
Aaron Boxer
Millogic


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 03, 2012 9:37 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
I don't think it's explicitly called out, but the real 68K doesn't fault, and the behaviour is controlled by the BCD unit, which as I recall deals with the nibbles and if the value >= $A then it adds in $6 to roll it into the next nibble or carry.

You could examine some of the more precise emulators (game) like Cyclone, or try it on some real 68K silicon, as a byte operating instruction the test space is relatively small, which also might shed some like on the "undefined" flag behaviour.

Emulators like StarSim just use the ADC;DAA pairing of the x86 so would inherit that's behaviour. Which is basically a two step process looking at the low order nibble, and then the high.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Wed Apr 04, 2012 6:17 pm 
Offline

Joined: Mon Mar 19, 2012 9:11 pm
Posts: 17
Your description of real silicon behavior matches the behavior of Easy68k.
I don't have access to a 68k chip so Easy68k is my "golden reference" for
verifying a verilog 68k design until I find a case where it is wrong.

Thanks for the help.

Aaron Boxer
Millogic


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 2 guests


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