2014-03-29 04:02 AM
Hello everyone, I just started learning STM8 assembly language, but can not find the decimal adjust instruction, so do not BCD arithmetic.
Have thought about writing a decimal adjustment subroutine, the addition should be able to overcome, but subtraction instruction (SUB SBC) does not affect the H flag, so after BCD subtraction does not know how to adjust.
May I ask how to properly use assembly language do BCD addition and subtraction?
2014-03-30 04:31 AM
Hi,
I usually code a BCD subtraction as a sum of the ten's complement of the subtrahend. Please, see Regards, EtaPhi2014-03-30 05:25 AM
Thanks for your
reply
, it seems that
the only
way to go.