EASy68K  
It is currently Sun Apr 05, 2020 11:27 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Mar 12, 2011 10:54 pm 
Offline

Joined: Thu Mar 10, 2011 4:09 am
Posts: 8
How do i convert a hex number in a data register to ascii?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 12, 2011 11:26 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
Assuming you want to convert each digit to an individual ASCII character you would proceed something like this:

If the digit is 0 through 9 add $30 to convert to ASCII.
If the digit is A through F add $37 to convert to ASCII.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 13, 2011 1:51 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
4-bits at a time?

Rotate your register for each digit, loading another register masking the significant 4-bits and index into a decode table. Most good texts on the 68K cover such a conversion if you care to study them.

See how the 32-bit register was displayed on the 8 digit 7 segment LED here. http://www.easy68k.com/EASy68Kforum/vie ... =2999#2999


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 9 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:  
Powered by phpBB® Forum Software © phpBB Group