单字节无符号除法程序 (R5R2R3R4/R7)=(R5)R2R3R4 余数R7汇编
- UID
- 1023166
- 性别
- 男
- 来自
- 燕山大学
|
单字节无符号除法程序 (R5R2R3R4/R7)=(R5)R2R3R4 余数R7汇编
入口 :R2,R3,R4,R7
;占用资源:ACC,B,F0
;堆栈需求:3字节
;出口 R5),R2,R3,R4,R7,OV
NDIV41 :MOV A,R5
MOV B,R7
DIV AB
PUSH A
MOV R5,B
MOV B,#18H
NDV411 :CLR C
MOV A,R4
RLC A
MOV R4,A
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
MOV A,R5
RLC A
MOV R5,A
MOV F0,C
CLR C
SUBB A,R7
JB F0,NDV412
JC NDV413
NDV412 :MOV R5,A
INC R4
NDV413 JNZ B,NDV411
POP A
CLR OV
JZ NDV414
SETB OV
NDV414 :XCH A,R5
MOV R7,A
RET |
|
|
|
|
|