;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.4.0 Tue Oct 12 01:18:44 2004

;--------------------------------------------------------
	.module sincoshf
	.optsdcc -mmcs51 --model-small
	
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _sincoshf
	.globl _sincoshf_PARM_2
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; special function bits 
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable register banks 
;--------------------------------------------------------
	.area REG_BANK_0	(REL,OVR,DATA)
	.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area DSEG    (DATA)
_sincoshf_PARM_2::
	.ds 2
_sincoshf_x_1_1::
	.ds 4
_sincoshf_z_1_1::
	.ds 4
_sincoshf_sloc0_1_0::
	.ds 4
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area OSEG    (OVR,DATA)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
	.area ISEG    (DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
	.area BSEG    (BIT)
_sincoshf_sign_1_1::
	.ds 1
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area XSEG    (XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG   (XDATA)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT  (CODE)
	.area GSFINAL (CODE)
	.area GSINIT  (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME    (CODE)
	.area CSEG    (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG    (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'sincoshf'
;------------------------------------------------------------
;iscosh                    Allocated with name '_sincoshf_PARM_2'
;x                         Allocated with name '_sincoshf_x_1_1'
;y                         Allocated to registers r6 r7 r0 r1 
;w                         Allocated to registers r2 r3 r4 r5 
;z                         Allocated with name '_sincoshf_z_1_1'
;sloc0                     Allocated with name '_sincoshf_sloc0_1_0'
;------------------------------------------------------------
;sincoshf.c:45: float sincoshf(const float x, const int iscosh)
;	-----------------------------------------
;	 function sincoshf
;	-----------------------------------------
_sincoshf:
	ar2 = 0x02
	ar3 = 0x03
	ar4 = 0x04
	ar5 = 0x05
	ar6 = 0x06
	ar7 = 0x07
	ar0 = 0x00
	ar1 = 0x01
;     genReceive
;sincoshf.c:54: if (x<0.0) { y=-x; sign=1; }
;     genAssign
;     genCall
	mov     _sincoshf_x_1_1,dpl
	mov     (_sincoshf_x_1_1 + 1),dph
	mov     (_sincoshf_x_1_1 + 2),b
	mov     (_sincoshf_x_1_1 + 3),a
	mov     ___fslt_PARM_2,#0x00
	mov     (___fslt_PARM_2 + 1),#0x00
	mov     (___fslt_PARM_2 + 2),#0x00
	mov     (___fslt_PARM_2 + 3),#0x00
;       Peephole 238.a  removed 4 redundant moves
	lcall	___fslt
	mov	a,dpl
;     genIfx
;     genIfxJump
;       Peephole 110    removed ljmp by inverse jump logic
	jz      00102$
00130$:
;     genUminus
;     genUminusFloat
	mov	r6,_sincoshf_x_1_1
	mov	r7,(_sincoshf_x_1_1 + 1)
	mov	r0,(_sincoshf_x_1_1 + 2)
	mov	a,(_sincoshf_x_1_1 + 3)
	cpl	acc.7
	mov	r1,a
;     genAssign
	setb	_sincoshf_sign_1_1
;       Peephole 112.b  changed ljmp to sjmp
	sjmp    00103$
00102$:
;sincoshf.c:55: else { y=x;  sign=0; }
;     genAssign
	mov	r6,_sincoshf_x_1_1
	mov	r7,(_sincoshf_x_1_1 + 1)
	mov	r0,(_sincoshf_x_1_1 + 2)
	mov	r1,(_sincoshf_x_1_1 + 3)
;     genAssign
	clr	_sincoshf_sign_1_1
00103$:
;sincoshf.c:57: if ((y>1.0) || iscosh)
;     genAssign
	mov	___fsgt_PARM_2,#0x00
	mov	(___fsgt_PARM_2 + 1),#0x00
	mov	(___fsgt_PARM_2 + 2),#0x80
	mov	(___fsgt_PARM_2 + 3),#0x3F
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	push	ar6
	push	ar7
	push	ar0
	push	ar1
	lcall	___fsgt
	mov	a,dpl
	pop	ar1
	pop	ar0
	pop	ar7
	pop	ar6
;     genIfx
;     genIfxJump
;       Peephole 109    removed ljmp by inverse jump logic
	jnz     00117$
00131$:
;     genIfx
	mov	a,_sincoshf_PARM_2
	orl	a,(_sincoshf_PARM_2 + 1)
;     genIfxJump
	jnz	00132$
	ljmp	00118$
00132$:
00117$:
;sincoshf.c:59: if(y>YBAR)
;     genAssign
	mov	___fsgt_PARM_2,#0x00
	mov	(___fsgt_PARM_2 + 1),#0x00
	mov	(___fsgt_PARM_2 + 2),#0x10
	mov	(___fsgt_PARM_2 + 3),#0x41
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	push	ar6
	push	ar7
	push	ar0
	push	ar1
	lcall	___fsgt
	mov	a,dpl
	pop	ar1
	pop	ar0
	pop	ar7
	pop	ar6
;     genIfx
;     genIfxJump
	jnz	00133$
	ljmp	00110$
00133$:
;sincoshf.c:61: w=y-K1;
;     genAssign
	mov	___fssub_PARM_2,#0x00
	mov	(___fssub_PARM_2 + 1),#0x73
	mov	(___fssub_PARM_2 + 2),#0x31
	mov	(___fssub_PARM_2 + 3),#0x3F
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	lcall	___fssub
;sincoshf.c:62: if (w>WMAX)
;     genAssign
;     genCall
	mov     r2,dpl
	mov     r3,dph
	mov     r4,b
	mov     r5,a
	mov     ___fsgt_PARM_2,#0xCF
	mov     (___fsgt_PARM_2 + 1),#0xBD
	mov     (___fsgt_PARM_2 + 2),#0x33
	mov     (___fsgt_PARM_2 + 3),#0x42
;       Peephole 238.a  removed 4 redundant moves
	push	ar2
	push	ar3
	push	ar4
	push	ar5
	lcall	___fsgt
	mov	a,dpl
	pop	ar5
	pop	ar4
	pop	ar3
	pop	ar2
;     genIfx
;     genIfxJump
;       Peephole 110    removed ljmp by inverse jump logic
	jz      00105$
00134$:
;sincoshf.c:64: errno=ERANGE;
;     genAssign
	clr	a
	mov	(_errno + 1),a
	mov	_errno,#0x22
;sincoshf.c:65: z=XMAX;
;     genAssign
	mov	_sincoshf_z_1_1,#0xFF
	mov	(_sincoshf_z_1_1 + 1),#0xFF
	mov	(_sincoshf_z_1_1 + 2),#0x7F
	mov	(_sincoshf_z_1_1 + 3),#0x7F
	ljmp	00111$
00105$:
;sincoshf.c:69: z=expf(w);
;     genCall
	mov	dpl,r2
	mov	dph,r3
	mov	b,r4
	mov	a,r5
	lcall	_expf
;sincoshf.c:70: z+=K3*z;
;     genAssign
;     genCall
	mov     _sincoshf_z_1_1,dpl
	mov     (_sincoshf_z_1_1 + 1),dph
	mov     (_sincoshf_z_1_1 + 2),b
	mov     (_sincoshf_z_1_1 + 3),a
	mov     ___fsmul_PARM_2,#0x97
	mov     (___fsmul_PARM_2 + 1),#0x08
	mov     (___fsmul_PARM_2 + 2),#0x68
	mov     (___fsmul_PARM_2 + 3),#0x37
;       Peephole 238.a  removed 4 redundant moves
	lcall	___fsmul
	mov	___fsadd_PARM_2,dpl
	mov	(___fsadd_PARM_2 + 1),dph
	mov	(___fsadd_PARM_2 + 2),b
	mov	(___fsadd_PARM_2 + 3),a
;     genCall
	mov	dpl,_sincoshf_z_1_1
	mov	dph,(_sincoshf_z_1_1 + 1)
	mov	b,(_sincoshf_z_1_1 + 2)
	mov	a,(_sincoshf_z_1_1 + 3)
	lcall	___fsadd
	mov	_sincoshf_z_1_1,dpl
	mov	(_sincoshf_z_1_1 + 1),dph
	mov	(_sincoshf_z_1_1 + 2),b
	mov	(_sincoshf_z_1_1 + 3),a
	ljmp	00111$
00110$:
;sincoshf.c:75: z=expf(y);
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	lcall	_expf
	mov	_sincoshf_z_1_1,dpl
	mov	(_sincoshf_z_1_1 + 1),dph
	mov	(_sincoshf_z_1_1 + 2),b
	mov	(_sincoshf_z_1_1 + 3),a
;sincoshf.c:76: w=1.0/z;
;     genAssign
	mov	___fsdiv_PARM_2,_sincoshf_z_1_1
	mov	(___fsdiv_PARM_2 + 1),(_sincoshf_z_1_1 + 1)
	mov	(___fsdiv_PARM_2 + 2),(_sincoshf_z_1_1 + 2)
	mov	(___fsdiv_PARM_2 + 3),(_sincoshf_z_1_1 + 3)
;     genCall
;       Peephole 182.b  used 16 bit load of dptr
	mov     dptr,#0x0000
	mov	b,#0x80
	mov	a,#0x3F
	lcall	___fsdiv
	mov	r2,dpl
	mov	r3,dph
	mov	r4,b
	mov	r5,a
;sincoshf.c:77: if(!iscosh) w=-w;
;     genIfx
	mov	a,_sincoshf_PARM_2
	orl	a,(_sincoshf_PARM_2 + 1)
;     genIfxJump
;       Peephole 109    removed ljmp by inverse jump logic
	jnz     00108$
00135$:
;     genUminus
;     genUminusFloat
	mov	a,r5
	cpl	acc.7
	mov	r5,a
00108$:
;sincoshf.c:78: z=(z+w)*0.5;
;     genAssign
	mov	___fsadd_PARM_2,r2
	mov	(___fsadd_PARM_2 + 1),r3
	mov	(___fsadd_PARM_2 + 2),r4
	mov	(___fsadd_PARM_2 + 3),r5
;     genCall
	mov	dpl,_sincoshf_z_1_1
	mov	dph,(_sincoshf_z_1_1 + 1)
	mov	b,(_sincoshf_z_1_1 + 2)
	mov	a,(_sincoshf_z_1_1 + 3)
	lcall	___fsadd
;     genAssign
;     genCall
	mov     _sincoshf_sloc0_1_0,dpl
	mov     (_sincoshf_sloc0_1_0 + 1),dph
	mov     (_sincoshf_sloc0_1_0 + 2),b
	mov     (_sincoshf_sloc0_1_0 + 3),a
	mov     ___fsmul_PARM_2,#0x00
	mov     (___fsmul_PARM_2 + 1),#0x00
	mov     (___fsmul_PARM_2 + 2),#0x00
	mov     (___fsmul_PARM_2 + 3),#0x3F
;       Peephole 238.a  removed 4 redundant moves
	lcall	___fsmul
	mov	_sincoshf_z_1_1,dpl
	mov	(_sincoshf_z_1_1 + 1),dph
	mov	(_sincoshf_z_1_1 + 2),b
	mov	(_sincoshf_z_1_1 + 3),a
00111$:
;sincoshf.c:80: if(sign) z=-z;
;     genIfx
;     genIfxJump
	jb	_sincoshf_sign_1_1,00136$
	ljmp	00119$
00136$:
;     genUminus
;     genUminusFloat
	mov	a,(_sincoshf_z_1_1 + 3)
	cpl	acc.7
	mov	(_sincoshf_z_1_1 + 3),a
	ljmp	00119$
00118$:
;sincoshf.c:84: if (y<EPS)
;     genAssign
	mov	___fslt_PARM_2,#0x00
	mov	(___fslt_PARM_2 + 1),#0x00
	mov	(___fslt_PARM_2 + 2),#0x80
	mov	(___fslt_PARM_2 + 3),#0x39
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	lcall	___fslt
	mov	a,dpl
;     genIfx
;     genIfxJump
;       Peephole 110    removed ljmp by inverse jump logic
	jz      00115$
00137$:
;sincoshf.c:85: z=x;
;     genAssign
	mov	_sincoshf_z_1_1,_sincoshf_x_1_1
	mov	(_sincoshf_z_1_1 + 1),(_sincoshf_x_1_1 + 1)
	mov	(_sincoshf_z_1_1 + 2),(_sincoshf_x_1_1 + 2)
	mov	(_sincoshf_z_1_1 + 3),(_sincoshf_x_1_1 + 3)
	ljmp	00119$
00115$:
;sincoshf.c:88: z=x*x;
;     genAssign
	mov	___fsmul_PARM_2,_sincoshf_x_1_1
	mov	(___fsmul_PARM_2 + 1),(_sincoshf_x_1_1 + 1)
	mov	(___fsmul_PARM_2 + 2),(_sincoshf_x_1_1 + 2)
	mov	(___fsmul_PARM_2 + 3),(_sincoshf_x_1_1 + 3)
;     genCall
	mov	dpl,_sincoshf_x_1_1
	mov	dph,(_sincoshf_x_1_1 + 1)
	mov	b,(_sincoshf_x_1_1 + 2)
	mov	a,(_sincoshf_x_1_1 + 3)
	lcall	___fsmul
	mov	_sincoshf_z_1_1,dpl
	mov	(_sincoshf_z_1_1 + 1),dph
	mov	(_sincoshf_z_1_1 + 2),b
	mov	(_sincoshf_z_1_1 + 3),a
;sincoshf.c:89: z=x+x*z*P(z)/Q(z);
;     genAssign
	mov	___fsmul_PARM_2,_sincoshf_z_1_1
	mov	(___fsmul_PARM_2 + 1),(_sincoshf_z_1_1 + 1)
	mov	(___fsmul_PARM_2 + 2),(_sincoshf_z_1_1 + 2)
	mov	(___fsmul_PARM_2 + 3),(_sincoshf_z_1_1 + 3)
;     genCall
	mov	dpl,_sincoshf_x_1_1
	mov	dph,(_sincoshf_x_1_1 + 1)
	mov	b,(_sincoshf_x_1_1 + 2)
	mov	a,(_sincoshf_x_1_1 + 3)
	lcall	___fsmul
	mov	r6,dpl
	mov	r7,dph
	mov	r0,b
	mov	r1,a
;     genAssign
	mov	___fsmul_PARM_2,#0xEA
	mov	(___fsmul_PARM_2 + 1),#0xE6
	mov	(___fsmul_PARM_2 + 2),#0x42
	mov	(___fsmul_PARM_2 + 3),#0xBE
;     genCall
	mov	dpl,_sincoshf_z_1_1
	mov	dph,(_sincoshf_z_1_1 + 1)
	mov	b,(_sincoshf_z_1_1 + 2)
	mov	a,(_sincoshf_z_1_1 + 3)
	push	ar6
	push	ar7
	push	ar0
	push	ar1
	lcall	___fsmul
	mov	r2,dpl
	mov	r3,dph
	mov	r4,b
	mov	r5,a
	pop	ar1
	pop	ar0
	pop	ar7
	pop	ar6
;     genAssign
	mov	___fsadd_PARM_2,#0xF0
	mov	(___fsadd_PARM_2 + 1),#0x69
	mov	(___fsadd_PARM_2 + 2),#0xE4
	mov	(___fsadd_PARM_2 + 3),#0xC0
;     genCall
	mov	dpl,r2
	mov	dph,r3
	mov	b,r4
	mov	a,r5
	push	ar6
	push	ar7
	push	ar0
	push	ar1
	lcall	___fsadd
	mov	___fsmul_PARM_2,dpl
	mov	(___fsmul_PARM_2 + 1),dph
	mov	(___fsmul_PARM_2 + 2),b
	mov	(___fsmul_PARM_2 + 3),a
	pop	ar1
	pop	ar0
	pop	ar7
	pop	ar6
;     genCall
	mov	dpl,r6
	mov	dph,r7
	mov	b,r0
	mov	a,r1
	lcall	___fsmul
	mov	r2,dpl
	mov	r3,dph
	mov	r4,b
	mov	r5,a
;     genAssign
	mov	___fsadd_PARM_2,#0x93
	mov	(___fsadd_PARM_2 + 1),#0x4F
	mov	(___fsadd_PARM_2 + 2),#0x2B
	mov	(___fsadd_PARM_2 + 3),#0xC2
;     genCall
	mov	dpl,_sincoshf_z_1_1
	mov	dph,(_sincoshf_z_1_1 + 1)
	mov	b,(_sincoshf_z_1_1 + 2)
	mov	a,(_sincoshf_z_1_1 + 3)
	push	ar2
	push	ar3
	push	ar4
	push	ar5
	lcall	___fsadd
	mov	___fsdiv_PARM_2,dpl
	mov	(___fsdiv_PARM_2 + 1),dph
	mov	(___fsdiv_PARM_2 + 2),b
	mov	(___fsdiv_PARM_2 + 3),a
	pop	ar5
	pop	ar4
	pop	ar3
	pop	ar2
;     genCall
	mov	dpl,r2
	mov	dph,r3
	mov	b,r4
	mov	a,r5
	lcall	___fsdiv
	mov	___fsadd_PARM_2,dpl
	mov	(___fsadd_PARM_2 + 1),dph
	mov	(___fsadd_PARM_2 + 2),b
	mov	(___fsadd_PARM_2 + 3),a
;     genCall
	mov	dpl,_sincoshf_x_1_1
	mov	dph,(_sincoshf_x_1_1 + 1)
	mov	b,(_sincoshf_x_1_1 + 2)
	mov	a,(_sincoshf_x_1_1 + 3)
	lcall	___fsadd
	mov	_sincoshf_z_1_1,dpl
	mov	(_sincoshf_z_1_1 + 1),dph
	mov	(_sincoshf_z_1_1 + 2),b
	mov	(_sincoshf_z_1_1 + 3),a
00119$:
;sincoshf.c:92: return z;
;     genRet
	mov	dpl,_sincoshf_z_1_1
	mov	dph,(_sincoshf_z_1_1 + 1)
	mov	b,(_sincoshf_z_1_1 + 2)
	mov	a,(_sincoshf_z_1_1 + 3)
00121$:
	ret
	.area CSEG    (CODE)
	.area XINIT   (CODE)
