假设 8 位处理器具有 ld、st、adc 以及加法和索引寄存器 X & Y 指向要相加的值,结果替换 *X:
ld 3,X
add 3,Y ; The first add is without carry
st 3,X
ld 2,X
adc 2,Y ; subsequent adds propagate carry.
st 2,X
ld 1,X
adc 1,Y
st 1,X
ld 0,X
adc 0,Y
st 0,X
Assuming an 8 bit processor with ld, st, adc and add and index registers X & Y which point to the values to be added, result replaces *X:
ld 3,X
add 3,Y ; The first add is without carry
st 3,X
ld 2,X
adc 2,Y ; subsequent adds propagate carry.
st 2,X
ld 1,X
adc 1,Y
st 1,X
ld 0,X
adc 0,Y
st 0,X
发布评论
评论(2)
假设 8 位处理器具有 ld、st、adc 以及加法和索引寄存器 X & Y 指向要相加的值,结果替换 *X:
Assuming an 8 bit processor with ld, st, adc and add and index registers X & Y which point to the values to be added, result replaces *X:
ADC
代表“ADd with Carry”,实际上就像将两个值相加,然后再将进位标志的值相加:就像:
或:
ADC
stands for "ADd with Carry", in fact it is like add two values and add again the value of the carry flag:is like:
or: