binary to bcd in software

Thread Starter

harry99932

Joined Dec 30, 2010
38
Hi Guys i wonder if you can help me, im fairly new to pics and im trying to implement a shift +3 algorithm. Im just wondering is the carry bit open to all locations i.e if i shift one file left then shift another file left without clearing the bit will i carry the bit shifted out of the first file into the lsb of the second file?

Probably a simple one but i cant find the answer and i dont have anyhting with me at the moment to try it!

Best regards,
Harry
 

t06afre

Joined May 11, 2009
5,934
The RLF, and RRF will shift the current value of carry bit always. The status of of carry bit will always depend on the previous instructions executed. Hope this help. By the way. Questions like this can easy be answered by single stepping through the code. And be able to debug is very important for a programmer. Please take a look at the first post here http://forum.allaboutcircuits.com/showthread.php?t=44852 And take some time to go through the Webseminars I recommend. It will give you a jumpstart in debugging.
 

Thread Starter

harry99932

Joined Dec 30, 2010
38
Thanks for the help guys thats what i needed to hear. I try desperatley not use prewritten code for help, gives you ideas but doesnt help you think at the right level, takes a <snip> of a lot longer this way though! Il definatley have a look at the debug topics.

Cheers for your time,
Harry
 
Last edited by a moderator:
Top