Jump to content
Sign in to follow this  

Recommended Posts

in C2C there is a built in function

 

bcd_to_char();

 

it is not supported in Boost??? is there a similar function in Boost

 

Please help.....

Share this post


Link to post
Share on other sites

Hello hvn0005,

 

I looked in the help file and could not find the function.

 

Maybe this will do the job :

 

// Input must be from 00 to 99 in BCD
// Output in decimal
unsigned char bcd_to_char ( unsigned char bcdval)
{
unsigned char bcd_hi;

bcd_hi = bcdval & 0xF0;   // Isolate MSB 7-6-5-4

bcd_hi>>=4;

return (bcd_hi*10)+(bcdval & 0x0F);
}

 

Is this what you want ?

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...