LJMP STA
ORG 0050H
STA:
MOV R0,#30H
MOV R1,#50H
MOV R2,#10H
MOV R3,#16
MOV DPTR,#2000H
LOOP1:
MOV A,R2
MOV @R0,A 10H~1FH分别赋值给30H~3FH
MOV A,@R0
MOVX @DPTR,A 30H~3FH分别传送到2000H~200FH
MOVX A,@DPTR
MOV @R1,A 2000H~200FH分别传给50H~5FH
INC R0
INC R1
INC R2
INC DPTR
DJNZ R3,LOOP1
SJMP $
END
如下即可:MOV R4, 20H
MOV R5, 20H
MOV R0, #21H
MOV R2, #19
LP:
MOV A, @R0
CLR C
SUBB A, R4
JCNEXT
MOV A, @R0
MOV R4, A
NEXT:
MOV A, @R0
CLR C
SUBB A, R5
JNC NEXT2
MOV A, @R0
MOV R5, A
NEXT2:
INC R0
DJNZ R2, LP
SJMP $
END
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)