Hi, how can I split a two digit number in separate digits in assembly?
For example, i got 00010111 which is 23, how can i split this numer to get 00000010 and 00000011? (2 and 3)
I'm using pic16f877a
You are asking for an 8-bit binary number to be converted to two 4-bit BCD numbers.
Probably the easiest way is to count how many times you can subtract 0x0A (10 in decimal) from your number, this gives the first digit of your answer. The remainder after subtraction is the second digit of your answer.