51单片机五字节数除二字节数
发布网友
发布时间:2022-04-19 13:18
我来回答
共2个回答
热心网友
时间:2023-09-18 15:07
WAVE6000验证通过
R7R6R5R4R3/R2R1
商放在R5R4R3
BUF1 EQU 2000H
BUF2 EQU 3000H
ORG 00H
AJMP _INIT_SYS
_INIT_SYS:
MOV SP,#80H
; R7R6R5R4R3/R2R1 = R5R4R3
MOV R1,#00H
MOV R2,#0FH
MOV R3,#04H
MOV R4,#05H
MOV R5,#06H
MOV R6,#08H
MOV R6,#0AH
LCALL _DIV
AJMP $
_DIV: ;{
CLR C
MOV 30H,#0
MOV 31H,#0
MOV 32H,#0
MOV 33H,#0
MOV 34H,#0
_DIV_LOOP:
CLR C
MOV A,R3
SUBB A,R1
MOV R3,A
MOV A,R4
SUBB A,R2
MOV R4,A
MOV A,R5
SUBB A,#0
MOV R5,A
MOV A,R6
SUBB A,#0
MOV R6,A
MOV A,R7
SUBB A,#0
MOV R7,A
JC _DIV_END
_INC_SHANG:
CLR C
MOV A,30H
ADDC A,#1
MOV 30H,A
MOV A,31H
ADDC A,#0
MOV 31H,A
MOV A,32H
ADDC A,#0
MOV 32H,A
MOV A,33H
ADDC A,#0
MOV 33H,A
MOV A,34H
ADDC A,#0
MOV 34H,A
LJMP _DIV_LOOP
_DIV_END:
CLR C
MOV A,R1
ADDC A,R3
MOV A,R2
ADDC A,R4
MOV R3,30H
MOV R4,31H
MOV R5,32H
RET
END
热心网友
时间:2023-09-18 15:08
不是很明白你的意思,麻烦你再说明白一点!