;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.5.0 #1020 (Oct 16 2005)
; This file generated Sun Oct 16 22:33:09 2005
;--------------------------------------------------------
	.module _atof
	.optsdcc -mmcs51 --model-small
	
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _atof
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
	.area RSEG    (DATA)
;--------------------------------------------------------
; special function bits 
;--------------------------------------------------------
	.area RSEG    (DATA)
;--------------------------------------------------------
; overlayable register banks 
;--------------------------------------------------------
	.area REG_BANK_0	(REL,OVR,DATA)
	.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area DSEG    (DATA)
_atof_s_1_1::
	.ds 3
_atof_value_1_1::
	.ds 4
_atof_fraction_1_1::
	.ds 4
_atof_sloc0_1_0::
	.ds 3
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area OSEG    (OVR,DATA)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
	.area ISEG    (DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
	.area BSEG    (BIT)
_atof_sign_1_1::
	.ds 1
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
	.area PSEG    (PAG,XDATA)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area XSEG    (XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG   (XDATA)
	.area CSEG    (CODE)
	.area GSINIT0 (CODE)
	.area GSINIT1 (CODE)
	.area GSINIT2 (CODE)
	.area GSINIT3 (CODE)
	.area GSINIT4 (CODE)
	.area GSINIT5 (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area CSEG    (CODE)
	.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 'atof'
;------------------------------------------------------------
;s                         Allocated with name '_atof_s_1_1'
;value                     Allocated with name '_atof_value_1_1'
;fraction                  Allocated with name '_atof_fraction_1_1'
;iexp                      Allocated to registers r2 
;sloc0                     Allocated with name '_atof_sloc0_1_0'
;sloc1                     Allocated with name '_atof_sloc1_1_0'
;------------------------------------------------------------
;_atof.c:23: float atof(char * s)
;	-----------------------------------------
;	 function atof
;	-----------------------------------------
_atof:
	ar2 = 0x02
	ar3 = 0x03
	ar4 = 0x04
	ar5 = 0x05
	ar6 = 0x06
	ar7 = 0x07
	ar0 = 0x00
	ar1 = 0x01
;     genReceive
	mov	_atof_s_1_1,dpl
	mov	(_atof_s_1_1 + 1),dph
	mov	(_atof_s_1_1 + 2),b
;_atof.c:30: while (isspace(*s)) s++;
;     genAssign
	mov	r5,_atof_s_1_1
	mov	r6,(_atof_s_1_1 + 1)
	mov	r7,(_atof_s_1_1 + 2)
00101$:
;     genPointerGet
;     genGenPointerGet
	mov	dpl,r5
	mov	dph,r6
	mov	b,r7
	lcall	__gptrget
;     genCall
;	Peephole 244.c	loading dpl from a instead of r0
	mov	r0,a
	mov	dpl,a
	push	ar5
	push	ar6
	push	ar7
	lcall	_isspace
	mov	r0,dpl
	pop	ar7
	pop	ar6
	pop	ar5
;     genAssign
	mov	_atof_s_1_1,r5
	mov	(_atof_s_1_1 + 1),r6
	mov	(_atof_s_1_1 + 2),r7
;     genIfx
	mov	a,r0
;     genIfxJump
;	Peephole 110	removed ljmp by inverse jump logic
	jz	00103$
00148$:
;     genPlus
;     genPlusIncr
;	tail increment optimized
	inc	r5
	cjne	r5,#0x00,00101$
	inc	r6
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00101$
00103$:
;_atof.c:33: if (*s == '-')
;     genPointerGet
;     genGenPointerGet
	mov	dpl,r5
	mov	dph,r6
	mov	b,r7
	lcall	__gptrget
	mov	r0,a
;     genCmpEq
;	Peephole 112.b	changed ljmp to sjmp
;	Peephole 199	optimized misc jump sequence
	cjne	r0,#0x2D,00107$
;00149$:
;	Peephole 200	removed redundant sjmp
00150$:
;_atof.c:35: sign=1;
;     genAssign
	setb	_atof_sign_1_1
;_atof.c:36: s++;
;     genPlus
;     genPlusIncr
	mov	a,#0x01
;	Peephole 236.a	used r5 instead of ar5
	add	a,r5
	mov	_atof_s_1_1,a
;	Peephole 181	changed mov to clr
	clr	a
;	Peephole 236.b	used r6 instead of ar6
	addc	a,r6
	mov	(_atof_s_1_1 + 1),a
	mov	(_atof_s_1_1 + 2),r7
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00108$
00107$:
;_atof.c:40: sign=0;
;     genAssign
	clr	_atof_sign_1_1
;_atof.c:41: if (*s == '+') s++;
;     genCmpEq
;	Peephole 112.b	changed ljmp to sjmp
;	Peephole 199	optimized misc jump sequence
	cjne	r0,#0x2B,00108$
;00151$:
;	Peephole 200	removed redundant sjmp
00152$:
;     genPlus
;     genPlusIncr
	mov	a,#0x01
;	Peephole 236.a	used r5 instead of ar5
	add	a,r5
	mov	_atof_s_1_1,a
;	Peephole 181	changed mov to clr
	clr	a
;	Peephole 236.b	used r6 instead of ar6
	addc	a,r6
	mov	(_atof_s_1_1 + 1),a
	mov	(_atof_s_1_1 + 2),r7
00108$:
;_atof.c:45: for (value=0.0; isdigit(*s); s++)
;     genAssign
	mov	_atof_value_1_1,#0x00
	mov	(_atof_value_1_1 + 1),#0x00
	mov	(_atof_value_1_1 + 2),#0x00
	mov	(_atof_value_1_1 + 3),#0x00
;     genAssign
	mov	_atof_sloc0_1_0,_atof_s_1_1
	mov	(_atof_sloc0_1_0 + 1),(_atof_s_1_1 + 1)
	mov	(_atof_sloc0_1_0 + 2),(_atof_s_1_1 + 2)
00121$:
;     genPointerGet
;     genGenPointerGet
	mov	dpl,_atof_sloc0_1_0
	mov	dph,(_atof_sloc0_1_0 + 1)
	mov	b,(_atof_sloc0_1_0 + 2)
	lcall	__gptrget
;     genCall
;	Peephole 244.c	loading dpl from a instead of r4
	mov	r4,a
	mov	dpl,a
	lcall	_isdigit
	mov	r4,dpl
;     genAssign
	mov	_atof_s_1_1,_atof_sloc0_1_0
	mov	(_atof_s_1_1 + 1),(_atof_sloc0_1_0 + 1)
	mov	(_atof_s_1_1 + 2),(_atof_sloc0_1_0 + 2)
;     genIfx
	mov	a,r4
;     genIfxJump
	jnz	00153$
	ljmp	00124$
00153$:
;_atof.c:47: value=10.0*value+(*s-'0');
;     genIpush
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
	mov	a,#0x20
	push	acc
	mov	a,#0x41
	push	acc
;     genCall
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
	lcall	___fsmul
	mov	r5,dpl
	mov	r6,dph
	mov	r7,b
	mov	r0,a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
;     genPointerGet
;     genGenPointerGet
	mov	dpl,_atof_sloc0_1_0
	mov	dph,(_atof_sloc0_1_0 + 1)
	mov	b,(_atof_sloc0_1_0 + 2)
	lcall	__gptrget
	mov	r2,a
	inc	dptr
	mov	_atof_sloc0_1_0,dpl
	mov	(_atof_sloc0_1_0 + 1),dph
;     genCast
	mov	a,r2
	rlc	a
	subb	a,acc
	mov	r3,a
;     genMinus
	mov	a,r2
	add	a,#0xd0
	mov	dpl,a
	mov	a,r3
	addc	a,#0xff
	mov	dph,a
;     genCall
	push	ar5
	push	ar6
	push	ar7
	push	ar0
	lcall	___sint2fs
	mov	r2,dpl
	mov	r3,dph
	mov	r4,b
	mov	r1,a
	pop	ar0
	pop	ar7
	pop	ar6
	pop	ar5
;     genIpush
	push	ar2
	push	ar3
	push	ar4
	push	ar1
;     genCall
	mov	dpl,r5
	mov	dph,r6
	mov	b,r7
	mov	a,r0
	lcall	___fsadd
	mov	_atof_value_1_1,dpl
	mov	(_atof_value_1_1 + 1),dph
	mov	(_atof_value_1_1 + 2),b
	mov	(_atof_value_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
;_atof.c:45: for (value=0.0; isdigit(*s); s++)
	ljmp	00121$
00124$:
;_atof.c:51: if (*s == '.')
;     genPointerGet
;     genGenPointerGet
	mov	dpl,_atof_sloc0_1_0
	mov	dph,(_atof_sloc0_1_0 + 1)
	mov	b,(_atof_sloc0_1_0 + 2)
	lcall	__gptrget
	mov	r2,a
;     genCmpEq
	cjne	r2,#0x2E,00154$
	sjmp	00155$
00154$:
	ljmp	00110$
00155$:
;_atof.c:53: s++;
;     genPlus
;     genPlusIncr
	mov	a,#0x01
	add	a,_atof_sloc0_1_0
	mov	_atof_s_1_1,a
;	Peephole 181	changed mov to clr
	clr	a
	addc	a,(_atof_sloc0_1_0 + 1)
	mov	(_atof_s_1_1 + 1),a
	mov	(_atof_s_1_1 + 2),(_atof_sloc0_1_0 + 2)
;_atof.c:54: for (fraction=0.1; isdigit(*s); s++)
;     genAssign
	mov	_atof_fraction_1_1,#0xCD
	mov	(_atof_fraction_1_1 + 1),#0xCC
	mov	(_atof_fraction_1_1 + 2),#0xCC
	mov	(_atof_fraction_1_1 + 3),#0x3D
;     genAssign
	mov	r2,_atof_s_1_1
	mov	r3,(_atof_s_1_1 + 1)
	mov	r4,(_atof_s_1_1 + 2)
00125$:
;     genPointerGet
;     genGenPointerGet
	mov	dpl,r2
	mov	dph,r3
	mov	b,r4
	lcall	__gptrget
;     genCall
;	Peephole 244.c	loading dpl from a instead of r1
	mov	r1,a
	mov	dpl,a
	push	ar2
	push	ar3
	push	ar4
	lcall	_isdigit
	mov	r1,dpl
	pop	ar4
	pop	ar3
	pop	ar2
;     genAssign
	mov	_atof_s_1_1,r2
	mov	(_atof_s_1_1 + 1),r3
	mov	(_atof_s_1_1 + 2),r4
;     genIfx
	mov	a,r1
;     genIfxJump
	jnz	00156$
	ljmp	00110$
00156$:
;_atof.c:56: value+=(*s-'0')*fraction;
;     genPointerGet
;     genGenPointerGet
	mov	dpl,r2
	mov	dph,r3
	mov	b,r4
	lcall	__gptrget
	mov	r1,a
	inc	dptr
	mov	r2,dpl
	mov	r3,dph
;     genCast
	mov	a,r1
	rlc	a
	subb	a,acc
	mov	r5,a
;     genMinus
	mov	a,r1
	add	a,#0xd0
	mov	dpl,a
	mov	a,r5
	addc	a,#0xff
	mov	dph,a
;     genCall
	push	ar2
	push	ar3
	push	ar4
	lcall	___sint2fs
	mov	r5,dpl
	mov	r6,dph
	mov	r7,b
	mov	r0,a
	pop	ar4
	pop	ar3
	pop	ar2
;     genIpush
	push	ar2
	push	ar3
	push	ar4
	push	_atof_fraction_1_1
	push	(_atof_fraction_1_1 + 1)
	push	(_atof_fraction_1_1 + 2)
	push	(_atof_fraction_1_1 + 3)
;     genCall
	mov	dpl,r5
	mov	dph,r6
	mov	b,r7
	mov	a,r0
	lcall	___fsmul
	mov	r5,dpl
	mov	r6,dph
	mov	r7,b
	mov	r0,a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
	pop	ar4
	pop	ar3
	pop	ar2
;     genIpush
	push	ar2
	push	ar3
	push	ar4
	push	ar5
	push	ar6
	push	ar7
	push	ar0
;     genCall
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
	lcall	___fsadd
	mov	_atof_value_1_1,dpl
	mov	(_atof_value_1_1 + 1),dph
	mov	(_atof_value_1_1 + 2),b
	mov	(_atof_value_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
	pop	ar4
	pop	ar3
	pop	ar2
;_atof.c:57: fraction*=0.1;
;     genIpush
	push	ar2
	push	ar3
	push	ar4
	mov	a,#0xCD
	push	acc
	mov	a,#0xCC
	push	acc
	mov	a,#0xCC
	push	acc
	mov	a,#0x3D
	push	acc
;     genCall
	mov	dpl,_atof_fraction_1_1
	mov	dph,(_atof_fraction_1_1 + 1)
	mov	b,(_atof_fraction_1_1 + 2)
	mov	a,(_atof_fraction_1_1 + 3)
	lcall	___fsmul
	mov	_atof_fraction_1_1,dpl
	mov	(_atof_fraction_1_1 + 1),dph
	mov	(_atof_fraction_1_1 + 2),b
	mov	(_atof_fraction_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
	pop	ar4
	pop	ar3
	pop	ar2
;_atof.c:54: for (fraction=0.1; isdigit(*s); s++)
	ljmp	00125$
00110$:
;_atof.c:62: if (toupper(*s)=='E')
;     genPointerGet
;     genGenPointerGet
	mov	dpl,_atof_s_1_1
	mov	dph,(_atof_s_1_1 + 1)
	mov	b,(_atof_s_1_1 + 2)
	lcall	__gptrget
;     genCall
;	Peephole 244.c	loading dpl from a instead of r2
	mov	r2,a
	mov	dpl,a
	lcall	_islower
	mov	a,dpl
;     genIfx
;     genIfxJump
;	Peephole 110	removed ljmp by inverse jump logic
	jz	00131$
00157$:
;     genAssign
	mov	r2,#0x00
	mov	r3,#0x00
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00132$
00131$:
;     genPointerGet
;     genGenPointerGet
	mov	dpl,_atof_s_1_1
	mov	dph,(_atof_s_1_1 + 1)
	mov	b,(_atof_s_1_1 + 2)
	lcall	__gptrget
;     genCast
;	Peephole 166	removed redundant mov
	mov	r4,a
	mov	ar2,r4
	rlc	a
	subb	a,acc
	mov	r3,a
00132$:
;     genCmpEq
	cjne	r2,#0x45,00158$
	cjne	r3,#0x00,00158$
	sjmp	00159$
00158$:
	ljmp	00118$
00159$:
;_atof.c:64: s++;
;     genPlus
;     genPlusIncr
	inc	_atof_s_1_1
	clr	a
	cjne	a,_atof_s_1_1,00160$
	inc	(_atof_s_1_1 + 1)
00160$:
;_atof.c:65: iexp=(char)atoi(s);
;     genCall
	mov	dpl,_atof_s_1_1
	mov	dph,(_atof_s_1_1 + 1)
	mov	b,(_atof_s_1_1 + 2)
	lcall	_atoi
	mov	r2,dpl
	mov	r3,dph
;     genCast
;_atof.c:67: while(iexp!=0)
00114$:
;     genCmpEq
	cjne	r2,#0x00,00161$
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00118$
00161$:
;_atof.c:69: if(iexp<0)
;     genCmpLt
;     genCmp
	mov	a,r2
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	acc.7,00112$
00162$:
;_atof.c:71: value*=0.1;
;     genIpush
	push	ar2
	mov	a,#0xCD
	push	acc
	mov	a,#0xCC
	push	acc
	mov	a,#0xCC
	push	acc
	mov	a,#0x3D
	push	acc
;     genCall
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
	lcall	___fsmul
	mov	_atof_value_1_1,dpl
	mov	(_atof_value_1_1 + 1),dph
	mov	(_atof_value_1_1 + 2),b
	mov	(_atof_value_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
	pop	ar2
;_atof.c:72: iexp++;
;     genPlus
;     genPlusIncr
	inc	r2
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00114$
00112$:
;_atof.c:76: value*=10.0;
;     genIpush
	push	ar2
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
	mov	a,#0x20
	push	acc
	mov	a,#0x41
	push	acc
;     genCall
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
	lcall	___fsmul
	mov	_atof_value_1_1,dpl
	mov	(_atof_value_1_1 + 1),dph
	mov	(_atof_value_1_1 + 2),b
	mov	(_atof_value_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
	pop	ar2
;_atof.c:77: iexp--;
;     genMinus
;     genMinusDec
	dec	r2
;	Peephole 112.b	changed ljmp to sjmp
	sjmp	00114$
00118$:
;_atof.c:83: if(sign) value*=-1.0;
;     genIfx
;     genIfxJump
;	Peephole 111	removed ljmp by inverse jump logic
	jnb	_atof_sign_1_1,00120$
00163$:
;     genIpush
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
;	Peephole 181	changed mov to clr
	clr	a
	push	acc
	mov	a,#0x80
	push	acc
	mov	a,#0xBF
	push	acc
;     genCall
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
	lcall	___fsmul
	mov	_atof_value_1_1,dpl
	mov	(_atof_value_1_1 + 1),dph
	mov	(_atof_value_1_1 + 2),b
	mov	(_atof_value_1_1 + 3),a
	mov	a,sp
	add	a,#0xfc
	mov	sp,a
00120$:
;_atof.c:84: return (value);
;     genRet
	mov	dpl,_atof_value_1_1
	mov	dph,(_atof_value_1_1 + 1)
	mov	b,(_atof_value_1_1 + 2)
	mov	a,(_atof_value_1_1 + 3)
00129$:
	ret
	.area CSEG    (CODE)
	.area XINIT   (CODE)
