;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.6.1 #4330 (Oct 18 2006)
; This file generated Wed Oct 18 23:31:02 2006
;--------------------------------------------------------
	.module _ulong2fs
	.optsdcc -mhc08
	
	.area HOME (CODE)
	.area GSINIT0 (CODE)
	.area GSINIT (CODE)
	.area GSFINAL (CODE)
	.area CSEG (CODE)
	.area XINIT
	.area CONST   (CODE)
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl ___ulong2fs_PARM_1
	.globl ___ulong2fs
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area	OSEG    (OVR)
___ulong2fs_sloc0_1_0::
	.ds 2
___ulong2fs_sloc1_1_0::
	.ds 4
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
___ulong2fs_PARM_1:
	.ds 4
___ulong2fs_exp_1_1:
	.ds 2
___ulong2fs_fl_1_1:
	.ds 4
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area HOME (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 '__ulong2fs'
;------------------------------------------------------------
;a                         Allocated with name '___ulong2fs_PARM_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'
;sloc1                     Allocated with name '___ulong2fs_sloc1_1_0'
;------------------------------------------------------------
;_ulong2fs.c:75: float __ulong2fs (unsigned long a )
;	-----------------------------------------
;	 function __ulong2fs
;	-----------------------------------------
___ulong2fs:
;_ulong2fs.c:80: if (!a)
;     genIfx
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 0)
	lda	(___ulong2fs_PARM_1 + 3)
	ora	(___ulong2fs_PARM_1 + 2)
	ora	(___ulong2fs_PARM_1 + 1)
	ora	___ulong2fs_PARM_1
;     genIfxJump
; Peephole 2c	- eliminated jmp
	bne	00115$
00121$:
;_ulong2fs.c:82: return 0.0;
;     genRet
	clr	*__ret3
	clr	*__ret2
;     loadRegFromAop (x, LIT(#0x00), 1)
	clrx
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, LIT(#0x00), 0)
	clra
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; Peephole 6a  - replaced jmp to rts with rts
	rts
;_ulong2fs.c:85: while (a & NORM) 
00115$:
;     genAssign
	clr	*___ulong2fs_sloc0_1_0
	mov	#0x96,*(___ulong2fs_sloc0_1_0 + 1)
00103$:
;     genAnd
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 3)
; Peephole 4a	- eliminated redundant tsta
	lda	___ulong2fs_PARM_1
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00117$
00122$:
;_ulong2fs.c:88: a >>= 1;
;     genRightShift
;     genRightShiftLiteral
;     genrshFour
;     loadRegFromAop (xa, EXT(___ulong2fs_PARM_1), 2)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 2)
	lda	(___ulong2fs_PARM_1 + 1)
;     loadRegFromAop (x, EXT(___ulong2fs_PARM_1), 3)
	ldx	___ulong2fs_PARM_1
	lsrx
	rora
;     storeRegToAop (xa, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___ulong2fs_PARM_1 + 1)
;     storeRegToAop (x, EXT(___ulong2fs_PARM_1), 3), stacked=0, isaddr=1
	stx	___ulong2fs_PARM_1
;     loadRegFromAop (xa, EXT(___ulong2fs_PARM_1), 0)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 0)
	lda	(___ulong2fs_PARM_1 + 3)
;     loadRegFromAop (x, EXT(___ulong2fs_PARM_1), 1)
	ldx	(___ulong2fs_PARM_1 + 2)
	rorx
	rora
;     storeRegToAop (xa, EXT(___ulong2fs_PARM_1), 0), stacked=0, isaddr=1
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 0), stacked=0, isaddr=1
	sta	(___ulong2fs_PARM_1 + 3)
;     storeRegToAop (x, EXT(___ulong2fs_PARM_1), 1), stacked=0, isaddr=1
	stx	(___ulong2fs_PARM_1 + 2)
;_ulong2fs.c:89: exp++;
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
;     loadRegFromAop (hx, DIR(___ulong2fs_sloc0_1_0), 0)
	ldhx	*___ulong2fs_sloc0_1_0
	aix	#1
;     storeRegToAop (hx, DIR(___ulong2fs_sloc0_1_0), 0), stacked=0, isaddr=0
	sthx	*___ulong2fs_sloc0_1_0
; Peephole 3	- shortened jmp to bra
	bra	00103$
;_ulong2fs.c:92: while (a < HIDDEN)
00117$:
;     genAssign
00106$:
;     genCmp	(<)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 2)
	lda	(___ulong2fs_PARM_1 + 1)
	sub	#0x80
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 3)
	lda	___ulong2fs_PARM_1
	sbc	#0x00
; Peephole 2a	- eliminated jmp
	bcc	00120$
00123$:
;_ulong2fs.c:94: a <<= 1;
;     genLeftShift
;     genLeftShiftLiteral
;     genlshFour
;     loadRegFromAop (xa, EXT(___ulong2fs_PARM_1), 0)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 0)
	lda	(___ulong2fs_PARM_1 + 3)
;     loadRegFromAop (x, EXT(___ulong2fs_PARM_1), 1)
	ldx	(___ulong2fs_PARM_1 + 2)
	lsla
	rolx
;     storeRegToAop (xa, EXT(___ulong2fs_PARM_1), 0), stacked=0, isaddr=1
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 0), stacked=0, isaddr=1
	sta	(___ulong2fs_PARM_1 + 3)
;     storeRegToAop (x, EXT(___ulong2fs_PARM_1), 1), stacked=0, isaddr=1
	stx	(___ulong2fs_PARM_1 + 2)
;     loadRegFromAop (xa, EXT(___ulong2fs_PARM_1), 2)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 2)
	lda	(___ulong2fs_PARM_1 + 1)
;     loadRegFromAop (x, EXT(___ulong2fs_PARM_1), 3)
	ldx	___ulong2fs_PARM_1
	rola
	rolx
;     storeRegToAop (xa, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___ulong2fs_PARM_1 + 1)
;     storeRegToAop (x, EXT(___ulong2fs_PARM_1), 3), stacked=0, isaddr=1
	stx	___ulong2fs_PARM_1
;_ulong2fs.c:95: exp--;
;     genMinus
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 0)
	lda	*(___ulong2fs_sloc0_1_0 + 1)
	sub	#0x01
;     storeRegToAop (a, DIR(___ulong2fs_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc0_1_0 + 1)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 1)
	lda	*___ulong2fs_sloc0_1_0
	sbc	#0x00
;     storeRegToAop (a, DIR(___ulong2fs_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*___ulong2fs_sloc0_1_0
; Peephole 3	- shortened jmp to bra
	bra	00106$
00120$:
;     genAssign
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 1)
	lda	*___ulong2fs_sloc0_1_0
;     storeRegToAop (a, EXT(___ulong2fs_exp_1_1), 1), stacked=0, isaddr=0
	sta	___ulong2fs_exp_1_1
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 0)
	lda	*(___ulong2fs_sloc0_1_0 + 1)
;     storeRegToAop (a, EXT(___ulong2fs_exp_1_1), 0), stacked=0, isaddr=0
	sta	(___ulong2fs_exp_1_1 + 1)
;_ulong2fs.c:99: if ((a&0x7fffff)==0x7fffff) {
;     genAnd
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 0)
	lda	(___ulong2fs_PARM_1 + 3)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 3)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 1)
	lda	(___ulong2fs_PARM_1 + 2)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 2)
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 2)
	lda	(___ulong2fs_PARM_1 + 1)
	and	#0x7F
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 1)
	clr	*___ulong2fs_sloc1_1_0
;     genCmpEQorNE	(==)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 0)
	lda	*(___ulong2fs_sloc1_1_0 + 3)
	cmp	#0xFF
	bne	00124$
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 1)
	lda	*(___ulong2fs_sloc1_1_0 + 2)
	cmp	#0xFF
	bne	00124$
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 2)
	lda	*(___ulong2fs_sloc1_1_0 + 1)
	cmp	#0x7F
	bne	00124$
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 3)
	lda	*___ulong2fs_sloc1_1_0
	cmp	#0x00
	beq	00125$
00124$:
; Peephole 3	- shortened jmp to bra
	bra	00110$
00125$:
;_ulong2fs.c:100: a=0;
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 3)
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 3), stacked=0, isaddr=1
;     loadRegFromAop (a, LIT(#0x00), 2)
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
;     loadRegFromAop (a, LIT(#0x00), 1)
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 1), stacked=0, isaddr=1
;     loadRegFromAop (a, LIT(#0x00), 0)
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 0), stacked=0, isaddr=1
; Peephole 5a   - eliminated redundant clra
	clra
	sta	___ulong2fs_PARM_1
	sta	(___ulong2fs_PARM_1 + 1)
	sta	(___ulong2fs_PARM_1 + 2)
	sta	(___ulong2fs_PARM_1 + 3)
;_ulong2fs.c:101: exp++;
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 1, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 0)
	lda	*(___ulong2fs_sloc0_1_0 + 1)
	add	#0x01
;     storeRegToAop (a, EXT(___ulong2fs_exp_1_1), 0), stacked=0, isaddr=0
	sta	(___ulong2fs_exp_1_1 + 1)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc0_1_0), 1)
	lda	*___ulong2fs_sloc0_1_0
	adc	#0x00
;     storeRegToAop (a, EXT(___ulong2fs_exp_1_1), 1), stacked=0, isaddr=0
	sta	___ulong2fs_exp_1_1
00110$:
;_ulong2fs.c:105: a &= ~HIDDEN ;
;     genAnd
;     loadRegFromAop (a, EXT(___ulong2fs_PARM_1), 2)
	lda	(___ulong2fs_PARM_1 + 1)
	and	#0x7F
;     storeRegToAop (a, EXT(___ulong2fs_PARM_1), 2), stacked=0, isaddr=1
	sta	(___ulong2fs_PARM_1 + 1)
;_ulong2fs.c:107: fl.l = PACK(0,(unsigned long)exp, a);
;     genCast
;     loadRegFromAop (a, EXT(___ulong2fs_exp_1_1), 0)
	lda	(___ulong2fs_exp_1_1 + 1)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 3)
;     loadRegFromAop (a, EXT(___ulong2fs_exp_1_1), 1)
	lda	___ulong2fs_exp_1_1
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 2)
;     loadRegFromAop (a, EXT(___ulong2fs_exp_1_1), 1)
	lda	___ulong2fs_exp_1_1
	rola	
	clra	
	sbc	#0x00
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 1)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*___ulong2fs_sloc1_1_0
;     genLeftShift
;     genLeftShiftLiteral
;     genlshFour
;     loadRegFromAop (xa, DIR(___ulong2fs_sloc1_1_0), 0)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 0)
	lda	*(___ulong2fs_sloc1_1_0 + 3)
;     loadRegFromAop (x, DIR(___ulong2fs_sloc1_1_0), 1)
	ldx	*(___ulong2fs_sloc1_1_0 + 2)
	lsrx
	rora
; transferRegReg(a,x)
	tax
	clra
	rora
;     storeRegToAop (xa, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 1)
;     storeRegToAop (x, DIR(___ulong2fs_sloc1_1_0), 3), stacked=0, isaddr=0
	stx	*___ulong2fs_sloc1_1_0
	clr	*(___ulong2fs_sloc1_1_0 + 3)
	clr	*(___ulong2fs_sloc1_1_0 + 2)
;     genOr
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 0)
	lda	*(___ulong2fs_sloc1_1_0 + 3)
	ora	(___ulong2fs_PARM_1 + 3)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 3)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 1)
	lda	*(___ulong2fs_sloc1_1_0 + 2)
	ora	(___ulong2fs_PARM_1 + 2)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 2)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 2)
	lda	*(___ulong2fs_sloc1_1_0 + 1)
	ora	(___ulong2fs_PARM_1 + 1)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 1)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 3)
	lda	*___ulong2fs_sloc1_1_0
	ora	___ulong2fs_PARM_1
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*___ulong2fs_sloc1_1_0
;     genPointerSet
;     genDataPointerSet
;     aopDerefAop(IMMD(___ulong2fs_fl_1_1))
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 3)
	lda	*___ulong2fs_sloc1_1_0
;     storeRegToAop (a, EXT(___ulong2fs_fl_1_1), 3), stacked=0, isaddr=0
	sta	___ulong2fs_fl_1_1
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 2)
	lda	*(___ulong2fs_sloc1_1_0 + 1)
;     storeRegToAop (a, EXT(___ulong2fs_fl_1_1), 2), stacked=0, isaddr=0
	sta	(___ulong2fs_fl_1_1 + 1)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 1)
	lda	*(___ulong2fs_sloc1_1_0 + 2)
;     storeRegToAop (a, EXT(___ulong2fs_fl_1_1), 1), stacked=0, isaddr=0
	sta	(___ulong2fs_fl_1_1 + 2)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 0)
	lda	*(___ulong2fs_sloc1_1_0 + 3)
;     storeRegToAop (a, EXT(___ulong2fs_fl_1_1), 0), stacked=0, isaddr=0
	sta	(___ulong2fs_fl_1_1 + 3)
;_ulong2fs.c:109: return (fl.f);
;     genPointerGet
;     genDataPointerGet
;     aopDerefAop(IMMD(___ulong2fs_fl_1_1))
;     loadRegFromAop (a, EXT(___ulong2fs_fl_1_1), 3)
	lda	___ulong2fs_fl_1_1
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*___ulong2fs_sloc1_1_0
;     loadRegFromAop (a, EXT(___ulong2fs_fl_1_1), 2)
	lda	(___ulong2fs_fl_1_1 + 1)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(___ulong2fs_fl_1_1), 1)
	lda	(___ulong2fs_fl_1_1 + 2)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 2)
;     loadRegFromAop (a, EXT(___ulong2fs_fl_1_1), 0)
	lda	(___ulong2fs_fl_1_1 + 3)
;     storeRegToAop (a, DIR(___ulong2fs_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(___ulong2fs_sloc1_1_0 + 3)
;     genRet
	mov	*___ulong2fs_sloc1_1_0,*__ret3
	mov	*(___ulong2fs_sloc1_1_0 + 1),*__ret2
;     loadRegFromAop (x, DIR(___ulong2fs_sloc1_1_0), 1)
	ldx	*(___ulong2fs_sloc1_1_0 + 2)
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(___ulong2fs_sloc1_1_0), 0)
	lda	*(___ulong2fs_sloc1_1_0 + 3)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00111$:
	rts
	.area CSEG (CODE)
	.area CONST   (CODE)
	.area XINIT
