• Advertisement
Sign in to follow this  

Decimal to BCD

This topic is 4904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Sounds like homework to me.
Here's a silly way to do it... should give you a hint though...
Write the integer as a string to memory (e.g. sprintf).
Read the buffer into an integer as a hex string (e.g. sscanf with %x).
Voila.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Write a couple assembly routines to do it for you ;~). Most processors still have BCD instructions, and if you write in assembly you can be sure that it won't be done the long way.

Share this post


Link to post
Share on other sites

This topic is 4904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement