Algorithm used:
- Binary to BCD conversion (note that result may be truncated, for example converting FFFF will result in 5535 in 16-bit mode)
- BCD to binary conversion (note that is invalid BCD digits are in TOS, no error will be thrown but result will be meaningless)
Both of these use adjacent shift registers and 1 - bit shift and (optional) correction steps which make them convenient for serial CPU.
# - TOS (BCD) <= TOS (binary)
(refer to microcode lines 419-448 , more details to come...)
$ - TOS (binary) <= TOS (BCD)
(refer to microcode lines 394-414 , more details to come...)
Example: converting 9999 to 270F and vice versa
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.