汇编语言 双字节加法程序段 求大神帮助补充完整

2025-01-18 21:12:58
推荐回答(2个)
回答1:

START:
PUSH ACC
MOV R0,#addr1
MOV R1,#addr3
MOV A,@R0
ADD A,@R1
MOV @R0,A
MOV R0,#addr2
MOV R1,#addr4
MOV A,@R0
ADDC A,@R1
MOV @R0,A
POP ACC
RET

回答2:

ADDR1 EQU10H
ADDR2 EQU20H
ADDR3 EQU30H
ADDR4 EQU40H
ADDST: PUSH ACC
MOV R0,#addr1;
MOV R1,#addr3;
CLR 1;
MOV A,@R0
ADD A,@R1;
MOV @R0,A
INC R0;
INC R1;
MOV A,@R0
ADDC A,@R1;
MOV @R0,A;
POP ACC;
RET