I am attempting to INC/DEC a BCD byte variable within my picaxe08m2 code. I could convert to binary using BCDTOBIN, then inc binByte, then convert the variable-byte back to BCD using BINTOBCD; but I'm using the 08M2, which doesn't support these conversion commands.
A while ago I seen a post response from Hippy offering a clever snippet;
BCDTOBIN command~ binByte = bcdByte / 16 * $FFFA + bcdByte
My question is; How do I write the conversion back to bcdByte after I increment/decrement the binByte?
Thanks in advance.
A while ago I seen a post response from Hippy offering a clever snippet;
BCDTOBIN command~ binByte = bcdByte / 16 * $FFFA + bcdByte
My question is; How do I write the conversion back to bcdByte after I increment/decrement the binByte?
Thanks in advance.