2个回答
展开全部
1:
;双字节数据相加:R3R2+R5R4=R3R2
ADDDB:
MOV A,R2
ADD A,R4
MOV R2,A
MOV A,R3
ADDC A,R5
MOV R3,A
RET
2:
;R1:R0/B=R1:R0
DIV16:
MOV R7,#08H
MOV B,#6
DIV1:
CLR C
MOV A,R0
RLC A
MOV R0,A
MOV A,R1
RLC A
MOV R1,A
CLR C
SUBB A,B
JC DIV2
MOV R1,A
INC R7
DIV2:
DJNZ R7,DIV1
RET
3:双字节循环左移:
RLDL:
MOV A,R2
RLC A
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
RET
;双字节数据相加:R3R2+R5R4=R3R2
ADDDB:
MOV A,R2
ADD A,R4
MOV R2,A
MOV A,R3
ADDC A,R5
MOV R3,A
RET
2:
;R1:R0/B=R1:R0
DIV16:
MOV R7,#08H
MOV B,#6
DIV1:
CLR C
MOV A,R0
RLC A
MOV R0,A
MOV A,R1
RLC A
MOV R1,A
CLR C
SUBB A,B
JC DIV2
MOV R1,A
INC R7
DIV2:
DJNZ R7,DIV1
RET
3:双字节循环左移:
RLDL:
MOV A,R2
RLC A
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
RET
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询