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

;--------------------------------------------------------
	.module _ulong2fs
	.optsdcc -mmcs51 --model-large
	
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl ___ulong2fs
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; special function bits 
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable register banks 
;--------------------------------------------------------
	.area REG_BANK_0	(REL,OVR,DATA)
	.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area DSEG    (DATA)
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area	OSEG    (OVR,DATA)
___ulong2fs_sloc0_1_0::
	.ds 2
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
	.area ISEG    (DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
	.area BSEG    (BIT)
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area XSEG    (XDATA)
___ulong2fs_a_1_1::
	.ds 4
___ulong2fs_exp_1_1::
	.ds 2
___ulong2fs_fl_1_1::
	.ds 4
;--------------------------------------------------------
; 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 '__ulong2fs'
;------------------------------------------------------------
;a                         Allocated with name '___ulong2fs_a_1_1'
;exp                       Allocated with name '___ulong2fs_exp_1_1'
;fl                        Allocated with name '___ulong2fs_fl_1_1'
;sloc0                     Allocated with name '___ulong2fs_sloc0_1_0'
;------------------------------------------------------------
;_ulong2fs.c:27: float __ulong2fs (unsigned long a )
;	-----------------------------------------
;	 function __ulong2fs
;	-----------------------------------------
___ulong2fs:
	ar2 = 0x02
	ar3 = 0x03
	ar4 = 0x04
	ar5 = 0x05
	ar6 = 0x06
	ar7 = 0x07
	ar0 = 0x00
	ar1 = 0x01
;     genReceive
	mov	r2,dpl
	mov	r3,dph
	mov	r4,b
	mov	r5,a
	mov	dptr,#___ulong2fs_a_1_1
	mov	a,r2
	movx	@dptr,a
	inc	dptr
	mov	a,r3
	movx	@dptr,a
	inc	dptr
	mov	a,r4
	movx	@dptr,a
	inc	dptr
	mov	a,r5
	movx	@dptr,a
;_ulong2fs.c:32: if (!a)
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	movx	a,@dptr
	mov	r2,a
	inc	dptr
	movx	a,@dptr
	mov	r3,a
	inc	dptr
	movx	a,@dptr
	mov	r4,a
	inc	dptr
	movx	a,@dptr
	mov	r5,a
;     genIfx
	mov	a,r2
	orl	a,r3
	orl	a,r4
	orl	a,r5
;     genIfxJump
;       Peephole 109    removed ljmp by inverse jump logic
	jnz     00115$
00119$:
;_ulong2fs.c:34: return 0.0;
;     genRet
	mov	dpl,#0x00
;       Peephole 3.a    changed mov to clr
;       Peephole 3.b    changed mov to clr
	clr     a
	mov     dph,a
	mov     b,a
	ljmp	00111$
;_ulong2fs.c:37: while (a & NORM) 
00115$:
;     genAssign
	mov	r2,#0x96
	mov	r3,#0x00
00103$:
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	movx	a,@dptr
	mov	r4,a
	inc	dptr
	movx	a,@dptr
	mov	r5,a
	inc	dptr
	movx	a,@dptr
	mov	r6,a
	inc	dptr
	movx	a,@dptr
;     genAnd
;       Peephole 105    removed redundant mov
	mov     r7,a
;       Peephole 110    removed ljmp by inverse jump logic
	jz      00117$
00120$:
;_ulong2fs.c:40: a >>= 1;
;     genRightShift
;     genRightShiftLiteral
;     genrshFour
	mov	a,r7
	clr	c
	rrc	a
	mov	r7,a
	mov	a,r6
	rrc	a
	mov	r6,a
	mov	a,r5
	rrc	a
	mov	r5,a
	mov	a,r4
	rrc	a
;     genAssign
;       Peephole 100    removed redundant mov
	mov     r4,a
	mov     dptr,#___ulong2fs_a_1_1
	movx    @dptr,a
	inc	dptr
	mov	a,r5
	movx	@dptr,a
	inc	dptr
	mov	a,r6
	movx	@dptr,a
	inc	dptr
	mov	a,r7
	movx	@dptr,a
;_ulong2fs.c:41: exp++;
;     genPlus
;     genPlusIncr
;	tail increment optimized
	inc	r2
	cjne	r2,#0x00,00103$
	inc	r3
;_ulong2fs.c:44: while (a < HIDDEN)
;       Peephole 112.b  changed ljmp to sjmp
	sjmp    00103$
00117$:
;     genAssign
	mov	___ulong2fs_sloc0_1_0,r2
	mov	(___ulong2fs_sloc0_1_0 + 1),r3
00106$:
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	movx	a,@dptr
	mov	r4,a
	inc	dptr
	movx	a,@dptr
	mov	r5,a
	inc	dptr
	movx	a,@dptr
	mov	r6,a
	inc	dptr
	movx	a,@dptr
	mov	r7,a
;     genCmpLt
;     genCmp
	clr	c
	mov	a,r4
	subb	a,#0x00
	mov	a,r5
	subb	a,#0x00
	mov	a,r6
	subb	a,#0x80
	mov	a,r7
	subb	a,#0x00
	clr	a
	rlc	a
	mov	r0,a
;     genAssign
	mov	dptr,#___ulong2fs_exp_1_1
	mov	a,___ulong2fs_sloc0_1_0
	movx	@dptr,a
	inc	dptr
	mov	a,(___ulong2fs_sloc0_1_0 + 1)
	movx	@dptr,a
;     genIfx
	mov	a,r0
;     genIfxJump
;       Peephole 110    removed ljmp by inverse jump logic
	jz      00108$
00121$:
;_ulong2fs.c:46: a <<= 1;
;     genLeftShift
;     genLeftShiftLiteral
;     genlshFour
	mov	a,r4
	add	a,acc
	mov	r0,a
	mov	a,r5
	rlc	a
	mov	r1,a
	mov	a,r6
	rlc	a
	mov	r2,a
	mov	a,r7
	rlc	a
	mov	r3,a
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	mov	a,r0
	movx	@dptr,a
	inc	dptr
	mov	a,r1
	movx	@dptr,a
	inc	dptr
	mov	a,r2
	movx	@dptr,a
	inc	dptr
	mov	a,r3
	movx	@dptr,a
;_ulong2fs.c:47: exp--;
;     genMinus
;     genMinusDec
;	tail decrement optimized
	dec	___ulong2fs_sloc0_1_0
	mov	a,#0xff
	cjne	a,___ulong2fs_sloc0_1_0,00106$
	dec	(___ulong2fs_sloc0_1_0 + 1)
;       Peephole 112.b  changed ljmp to sjmp
	sjmp    00106$
00108$:
;_ulong2fs.c:51: if ((a&0x7fffff)==0x7fffff) {
;     genAnd
	anl	ar6,#0x7F
	mov	r7,#0x00
;     genCmpEq
;       Peephole 112.b  changed ljmp to sjmp
;       Peephole 194    optimized misc jump sequence
	cjne    r4,#0xFF,00110$
	cjne    r5,#0xFF,00110$
	cjne    r6,#0x7F,00110$
	cjne    r7,#0x00,00110$
;00122$:
;       Peephole 200    removed redundant sjmp
00123$:
;_ulong2fs.c:52: a=0;
;     genAssign
;       Peephole 227    replaced inefficient 32 bit clear
	mov     dptr,#___ulong2fs_a_1_1
	clr     a
	movx    @dptr,a
	inc     dptr
	movx    @dptr,a
	inc     dptr
	movx    @dptr,a
	inc     dptr
	movx    @dptr,a
;_ulong2fs.c:53: exp++;
;     genPlus
;       Peephole 231    removed redundant mov to dptr
	mov     dptr,#___ulong2fs_exp_1_1
;     genPlusIncr
	mov	a,#0x01
	add	a,___ulong2fs_sloc0_1_0
	movx	@dptr,a
;       Peephole 181    changed mov to clr
	clr     a
	addc	a,(___ulong2fs_sloc0_1_0 + 1)
	inc	dptr
	movx	@dptr,a
00110$:
;_ulong2fs.c:57: a &= ~HIDDEN ;
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	movx	a,@dptr
	mov	r2,a
	inc	dptr
	movx	a,@dptr
	mov	r3,a
	inc	dptr
	movx	a,@dptr
	mov	r4,a
	inc	dptr
	movx	a,@dptr
	mov	r5,a
;     genAnd
	mov	dptr,#___ulong2fs_a_1_1
	mov	a,r2
	movx	@dptr,a
	inc	dptr
	mov	a,r3
	movx	@dptr,a
	mov	a,#0x7F
	anl	a,r4
	inc	dptr
	movx	@dptr,a
	inc	dptr
	mov	a,r5
	movx	@dptr,a
;_ulong2fs.c:59: fl.l = PACK(0,(unsigned long)exp, a);
;     genAssign
	mov	dptr,#___ulong2fs_exp_1_1
	movx	a,@dptr
	mov	r2,a
	inc	dptr
	movx	a,@dptr
;     genCast
;       Peephole 105    removed redundant mov
	mov     r3,a
	rlc	a
	subb	a,acc
	mov	r4,a
	mov	r5,a
;     genLeftShift
;     genLeftShiftLiteral
;     genlshFour
	mov	ar4,r2
	mov	a,r3
	anl	a,#0x01
	mov	c,acc.0
	xch	a,r4
	rrc	a
	xch	a,r4
	rrc	a
	xch	a,r4
	mov	r5,a
	mov	r3,#0x00
	mov	r2,#0x00
;     genAssign
	mov	dptr,#___ulong2fs_a_1_1
	movx	a,@dptr
	mov	r6,a
	inc	dptr
	movx	a,@dptr
	mov	r7,a
	inc	dptr
	movx	a,@dptr
	mov	r0,a
	inc	dptr
	movx	a,@dptr
	mov	r1,a
;     genOr
	mov	a,r6
	orl	ar2,a
	mov	a,r7
	orl	ar3,a
	mov	a,r0
	orl	ar4,a
	mov	a,r1
	orl	ar5,a
;     genPointerSet
;     genFarPointerSet
	mov	dptr,#___ulong2fs_fl_1_1
	mov	a,r2
	movx	@dptr,a
	inc	dptr
	mov	a,r3
	movx	@dptr,a
	inc	dptr
	mov	a,r4
	movx	@dptr,a
	inc	dptr
	mov	a,r5
	movx	@dptr,a
;_ulong2fs.c:61: return (fl.f);
;     genPointerGet
;     genFarPointerGet
	mov	dptr,#___ulong2fs_fl_1_1
	movx	a,@dptr
	mov	r2,a
	inc	dptr
	movx	a,@dptr
	mov	r3,a
	inc	dptr
	movx	a,@dptr
	mov	r4,a
	inc	dptr
	movx	a,@dptr
;     genRet
;       Peephole 191    removed redundant mov
	mov     r5,a
	mov     dpl,r2
	mov     dph,r3
	mov     b,r4
00111$:
	ret
	.area CSEG    (CODE)
	.area XINIT   (CODE)
