单片机实验,跪求大神!数据区传送子程序

2025-01-02 23:15:48
推荐回答(1个)
回答1:

;
MOV R2, #10H
MOV R3, #00H
MOV R4, #20H
MOV R5, #00H
LOOP:
MOV DPH, R2
MOV DPL, R3
MOVX A, @DPTR
INC DPTR
MOV R2, DPH
MOV R3, DPL
CJNE A, #'@', SAVE
JMP EXIT

SAVE:
MOV DPH, R4
MOV DPL, R5
MOVX @DPTR, A
INC DPTR
MOV R4, DPH
MOV R5, DPL
JMP LOOP

EXIT:
SJMP $

END