Hey all! Thought there has to be at least 1 guy doing assembly here, so I decided to ask: I'm trying to convert a hexadecimal 8-digit binary number (I.E. 0001 1110 = 2E) How would I go about making 2E = 46 from hex to ascii? I will have 3 registers to express the value, since the max an 8 digit binary number can represent is 255. So, I have 0001 1110, and I need to somehow figure out how to find out that this value is 46, represent that in two different nibbles, and add them to a register that has the default value 30. However, I do not know how to discover the 4 or the 6 for the value. As well, how can i add on top of that to get a hundreds place digit, so if the value is 120, how do I get the 1? There has to be a systematic explanation, I just don't know how to approach it. Oh, I'm using a PIC16F8X microcontroller.

How would you go about dividing by 10 in assembly? I can't even get the remainder in assembly... that's not a plausible explanation

There should be instructions for division and obtaining a modulo. Probably div and mod. Go find a reference manual.

It's a pic. I have rrf and rlf, nothing else to work with. I have sub, but I'd have to build the division operation. I'm not going to do that when it's not necessary. I only have 200 clock cycles to work with anyway. Don't worry though, I figured out the algorithm.