AnsweredAssumed Answered

About STM8 decimal adjust

Question asked by kyy.ysc on Mar 29, 2014
Latest reply on Mar 30, 2014 by kyy.ysc

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?