FLTCOS:
LCALL FABS
MOV R5,#1
MOV R6,#0C9H
MOV R7,#10H
CLR 1EH
MOV A,@R0
MOV C,ACC.7
MOV 1FH,C
MOV C,ACC.6
MOV ACC.7,C
MOV R2,A
INC R0
MOV A,@R0
MOV R3,A
INC R0
MOV A,@R0
MOV R4,A
DEC R0
DEC R0
CLR F0
FPLN1:
SETB 7CH
ACALL LD4
ACALL LD0
ACALL FPMU
SJMP FLN0
FPLN2:
CLR 7CH
FLN0:
ACALL LD1
POP DPH
POP DPL
CLR A
MOVC A,@A+DPTR
MOV R0,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R1,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R2,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R3,A;取an
INC DPTR
PLN:
ACALL M1
CLR A
MOVC A,@A+DPTR
MOV R0,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R1,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R2,A
INC DPTR
CLR A
MOVC A,@A+DPTR
MOV R3,A;取ai-1
INC DPTR
ACALL FPLAD
CLR A
MOVC A,@A+DPTR
ACALL GET1
DEC A
JNZ PLN
PEND:
JNB 7CH,REND
ACALL GET4
ACALL M1
REND:
MOV A,#1
;保存结果,接着运行下面的FSIN程序
MOV0:
INC R0
INC R0
MOV A,R4
MOV @R0,A
DEC R0
MOV A,R3
MOV @R0,A
DEC R0
MOV A,R2
MOV C,1FH
MOV ACC.7,C
MOV @R0,A
CLR ACC.7
CLR OV
CJNE A,#3FH,MV01
SETB OV
MV01:
MOV A,@R0
RET