51单片机汇编语言编程 两个10字节的无符号数的相加

2024-12-02 03:22:01
推荐回答(2个)
回答1:

楼上的程序,少了个@.
MOV R0, #40H
MOV R1, #60H
MOV R2, #0AH
CLR C
LOOP1:
MOV A, @R0
ADDC A, @R1
MOV @R1, A ;这里少了个@.
INC R0
INC R1
DJNZ R2, LOOP1
END

回答2:

MOV R0,#40H
MOV R1,#60H
MOV R2,#0AH
CLR C
LOOP1:
MOV A,@R0
ADDC A,@R1
MOV @R1,A
INC R0
INC R1
DJNZ R2,LOOP1
END