控制/MCU
浮点取整函数
入口条件:操作数在[R0]中。FINT: LCALL MVR0
LCALL INT
LJMP MOV0
INT: MOV A,R3
ORL A,R4
JNZ INTA
CLR 1FH
MOV R2,#41H
RET
INTA: MOV A,R2
JZ INTB
JB ACC.7,INTB
CLR C
SUBB A,#10H
JC INTD
RET
INTB: CLR A
MOV R4,A
MOV C,1FH
RRC A
MOV R3,A
RL A
MOV R2,A
JNZ INTC
MOV R2,#41H
INTC: RET
INTD: CLR F0
INTE: CLR C
LCALL RR1
ORL C,F0
MOV F0,C
CJNE R2,#10H,INTE
JNB F0,INTF
JNB 1FH,INTF
INC R4
MOV A,R4
JNZ INTF
INC R3
INTF: LJMP RLN
全部0条评论
快来发表一下你的评论吧 !