Try this algorithm
Let N = the binary number to be converted, for an 8 bit number, N < 256.
I'll use decimal numbers rather than binary for simplicity.
Let H = the hundreds digit, T = the tens digit, U = the units digit.
Initialise H = 0, T = 0
A If N < 100 then GOTO B
N = N - 100, H = H + 1, GOTO A
(at the end of this loop, H = the hundreds digit)
B If N < 10 then GOTO C
N = N - 10, T = T + 1, GOTO B
(at the end of this loop, T = the tens digit)
C U = N
(ie. the remainder is the units digit)
So the BCD number is H T U
Len