三位bcd加法计数器
Problem statement:
问题陈述:
To perform addition operation between two 8-bit BCD numbers using 8085 microprocessor.
使用8085微处理器在两个8位BCD编号之间执行加法运算。
Algorithm:
算法:
Load the two numbers in HL pair register.
将这两个数字加载到HL对寄存器中。
Store 00 on a register to calculate carry.
将00存储在寄存器中以计算进位。
Move the content of register H to accumulator.
将寄存器H的内容移至累加器。
Add the content of accumulator with the content of register L.
将累加器的内容与寄存器L的内容相加。
Check if the sum is greater than 09 then add 06 to result.
检查总和是否大于09,然后将06加到结果中。
If carry flag is equal to 0, goto step no 8 otherwise goto step no 7.
如果进位标志等于0,则转到步骤8,否则转到步骤7。
Increment the value of carry by 1.
将进位值增加1。
Store the result in memory.
将结果存储在内存中。
Move the content from register to accumulator.
将内容从寄存器移到累加器。
Load the result in memory.
将结果加载到内存中。
Terminate the program.
终止程序。
Program:
程序:
LHLD 2050
MVI C, 00
MOV A, H
ADD L
DAA
JNC **
INR C
** STA 3050
MOV A, C
STA 3051
HLT
Observation:
观察:
INPUT:
2050:32
2051:77
OUTPUT:
3050:01
3051:09
Hence we successfully added two BCD number with carry.
因此,我们成功地将两个BCD号码加进了进位 。
翻译自: https://www.includehelp.com/embedded-system/addition-of-two-8-bit-bcd-numbers-using-8085-microprocessor.aspx
三位bcd加法计数器