DATA EQU 30H
INCPID:
MOV R1,#DATA
MQV R0,#.COEFUR
SETB 3AH
MOV A,@R0
MOV R6,A
INC R0
MOV A,@R0
MOV R2,A
INC R0
MOV A,@R0
MOV R3,A
DEC R0
DEC R0
MOV A,@R1
MOV R4,A
INC R1
MOV A,@R1
DEC R1
DEC R1
MOV A,R6
MOV C,ACC.7
MOV 38H,C
XRL A,R7
JNB ACC.7,FA1
CPL 3AH
FA1:
MOV A,R6
MOV C,ACC.6
MOV ACC.7,C
MOV R6,A
MOV A,R7
MOV C,ACC.6
MOV ACC.7,C
MOV R7,A
CLR C
MOV A,R6
SUBB A,R7
JZ FA2
CLR PWS.5
CLR 39H
JB ACC.7,FA5
CJNE R4,#0,FA6
CJNE R5,#0,FA6
FA2:
JB 3AH,FA8
MOV A,R3
ADD A,R5
MOV R3,A
MOV A,R2
ADDC A,R4
MOV R2,A
JNC FA4
SETB 39H
CLR C
FA3:
CLR PWS.5
FSDT:
JC FS2
MOV C,39H
JB PWS.5,FS1
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS1:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS2:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS5
MOV R6,#41H
FS3:
RET
FS4:
JB ACC.7,FS3
FS5:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS2
FA4:
CJNE R2,#0,.FAA
CJNE R3,#0,FAA
MOV R4,#41H
RET
FAA:
MOV A,R6
MOV C,38H
MOV ACC.7,C
XCH A,R4
MOV R6,A
RET
FA5:
CJNE R2,#0,.FA7
CJNE R3,#0,FA7
MOV A,R7
MOV R6,A
SJMP FA2
FA6:
CPL PWS.5
FA7:
CLR C
JC FS2
MOV C,39H
JB PWS.5,FS6
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS6:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS7:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS10
MOV R6,#41H
FS8:
RET
FS9:
JB ACC.7,FS8
FS10:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS7
SJMP FA1
FA8:
MOV A,R3
CLR C
SUBB A,R5
MOV R3,A
MOV A,R2
SUBB A,R4
MOV R2,A
JNC FA9
CLR A
CLR C
SUBB A,R3
MOV R3,A
CLR A
SUBB A,R2
MOV R2,A
CPL 38H
SETB C
SJMP FA3
MOV R1,#BIASED
LCALL FSTR
MOV R0,#BIASED
MOV R1,#BIASE1
MOV A,R3
ADD A,R5
MOV R3,A
MOV A,R2
ADDC A,R4
MOV R2,A
JNC FA4
SETB 39H
CLR C
FA3:
CLR PWS.5
FSDT:
JC FS2
MOV C,39H
JB PWS.5,FS1
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS1:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS2:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS5
MOV R6,#41H
FS3:
RET
FS4:
JB ACC.7,FS3
FS5:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS2
FA4:
CJNE R2,#0,.FAA
CJNE R3,#0,FAA
MOV R4,#41H
RET
FAA:
MOV A,R6
MOV C,38H
MOV ACC.7,C
XCH A,R4
MOV R6,A
RET
FA5:
CJNE R2,#0,.FA7
CJNE R3,#0,FA7
MOV A,R7
MOV R6,A
SJMP FA2
FA6:
CPL PWS.5
FA7:
CLR C
JC FS2
MOV C,39H
JB PWS.5,FS6
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS6:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS7:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS10
MOV R6,#41H
FS8:
RET
FS9:
JB ACC.7,FS8
FS10:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS7
SJMP FA1
FA8:
MOV A,R3
CLR C
SUBB A,R5
MOV R3,A
MOV A,R2
SUBB A,R4
MOV R2,A
JNC FA9
CLR A
CLR C
SUBB A,R3
MOV R3,A
CLR A
SUBB A,R2
MOV R2,A
CPL 38H
SETB C
SJMP FA3
MOV R1,#MIDLE1
LCALL FSTR
MOV R0,#COEFKP
LCALL FMUL
MOV R0,#MIDLE2
LCALL FSTR
MOV R0,#COEFKI
MOV R1,#BIASED
LCALL FMUL
MOV R1,#MIDLE3
LCALL FSTR
MOV R0,#BIASPP
LCALL FADD
MOV R1,#MIDEL2
LCALL FSTR
MOV R0,#MIDLE1
MOV R1,#BIASE 1
MOV A,R3
ADD A,R5
MOV R3,A
MOV A,R2
ADDC A,R4
MOV R2,A
JNC FA4
SETB 39H
CLR C
FA3:
CLR PWS.5
FSDT:
JC FS2
MOV C,39H
JB PWS.5,FS1
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS1:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS2:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS5
MOV R6,#41H
FS3:
RET
FS4:
JB ACC.7,FS3
FS5:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS2
FA4:
CJNE R2,#0,.FAA
CJNE R3,#0,FAA
MOV R4,#41H
RET
FAA:
MOV A,R6
MOV C,38H
MOV ACC.7,C
XCH A,R4
MOV R6,A
RET
FA5:
CJNE R2,#0,.FA7
CJNE R3,#0,FA7
MOV A,R7
MOV R6,A
SJMP FA2
FA6:
CPL PWS.5
FA7:
CLR C
JC FS2
MOV C,39H
JB PWS.5,FS6
MOV A,R2
RRC A
MOV R2,A
MOV A,R3
RRC A
MOV R3,A
INC R6
RET
FS6:
MOV A,R4
RRC A
MOV R4,A
MOV A,R5
RRC A
MOV R5,A
INC R7
RET
FS7:
MOV A,R2
JNZ FS4
CJNE R3,#0,FS10
MOV R6,#41H
FS8:
RET
FS9:
JB ACC.7,FS8
FS10:
MOV C,PWS.5
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
RLC A
MOV R2,A
CLR PWS.5
DEC R6
SJMP FS7
SJMP FA1
FA8:
MOV A,R3
CLR C
SUBB A,R5
MOV R3,A
MOV A,R2
SUBB A,R4
MOV R2,A
JNC FA9
CLR A
CLR C
SUBB A,R3
MOV R3,A
CLR A
SUBB A,R2
MOV R2,A
CPL 38H
SETB C
SJMP FA3
MOV R1,#MIDLE3
LCALL FSTR
MOV R0,#BIASE2
LCALL FADD
MOV R1,#MIDLE3
LCALL FSTR
MOV R0,#COEFKD
LCALL FMUL
.MOV R1,#MIDLE1
LCALL FSRT
MOV R0,#MIDLE2
LCALL FADD
MOV R1,#BIAPID
LCALL FSTR
MOV R0,#BIAPID
LCALL FINT
MOV 52H,4FH
MOV 53H,50H
MOV 54H,51H
MOV 4FH,4CH
MOV 50H,4DH
MOV 51H,4EH
RET