;--------------------------------------------------------
; 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 _itoa
	.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 __itoa
	.globl __uitoa
	.globl __itoa_PARM_3
	.globl __itoa_PARM_2
	.globl __uitoa_PARM_3
	.globl __uitoa_PARM_2
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
__uitoa_sloc0_1_0:
	.ds 1
__uitoa_sloc1_1_0:
	.ds 2
__uitoa_sloc2_1_0:
	.ds 2
__uitoa_sloc3_1_0:
	.ds 2
__uitoa_sloc4_1_0:
	.ds 2
__itoa_sloc0_1_0:
	.ds 2
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area OSEG    (OVR)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
__uitoa_PARM_2:
	.ds 2
__uitoa_PARM_3:
	.ds 1
__uitoa_value_1_1:
	.ds 2
__itoa_PARM_2:
	.ds 2
__itoa_PARM_3:
	.ds 1
__itoa_value_1_1:
	.ds 2
;--------------------------------------------------------
; 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 '_uitoa'
;------------------------------------------------------------
;sloc0                     Allocated with name '__uitoa_sloc0_1_0'
;sloc1                     Allocated with name '__uitoa_sloc1_1_0'
;sloc2                     Allocated with name '__uitoa_sloc2_1_0'
;sloc3                     Allocated with name '__uitoa_sloc3_1_0'
;sloc4                     Allocated with name '__uitoa_sloc4_1_0'
;string                    Allocated with name '__uitoa_PARM_2'
;radix                     Allocated with name '__uitoa_PARM_3'
;value                     Allocated with name '__uitoa_value_1_1'
;index                     Allocated to registers 
;i                         Allocated to registers 
;------------------------------------------------------------
;_itoa.c:18: void _uitoa(unsigned int value, char* string, unsigned char radix)
;	-----------------------------------------
;	 function _uitoa
;	-----------------------------------------
__uitoa:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(__uitoa_value_1_1), 0), stacked=0, isaddr=0
	sta	(__uitoa_value_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(__uitoa_value_1_1), 1), stacked=0, isaddr=0
	stx	__uitoa_value_1_1
;_itoa.c:26: do {
;     genAssign
	mov	#0x10,*__uitoa_sloc0_1_0
00103$:
;_itoa.c:27: string[--index] = '0' + (value % radix);
;     genMinus
;     genMinusDec
	dec	*__uitoa_sloc0_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc1_1_0
;     genCast
;     loadRegFromAop (a, EXT(__uitoa_PARM_3), 0)
	lda	__uitoa_PARM_3
;     storeRegToAop (a, EXT(__moduint_PARM_2), 0), stacked=0, isaddr=1
	sta	(__moduint_PARM_2 + 1)
	clra
;     storeRegToAop (a, EXT(__moduint_PARM_2), 1), stacked=0, isaddr=1
	sta	__moduint_PARM_2
;     genCall
;     loadRegFromAop (x, EXT(__uitoa_value_1_1), 1)
	ldx	__uitoa_value_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(__uitoa_value_1_1), 0)
	lda	(__uitoa_value_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__moduint
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, DIR(__uitoa_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(__uitoa_sloc2_1_0 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, DIR(__uitoa_sloc2_1_0), 1), stacked=0, isaddr=0
	stx	*__uitoa_sloc2_1_0
;     genCast
;     loadRegFromAop (a, DIR(__uitoa_sloc2_1_0), 0)
	lda	*(__uitoa_sloc2_1_0 + 1)
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
; checking pset operandsEqu
;     genPlus
; IS_AOP_HX = 0
; icount = 48, sameRegs=1
;     genPlusIncr
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	add	#0x30
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genPointerSet
;     loadRegFromAop (hx, DIR(__uitoa_sloc1_1_0), 0)
	ldhx	*__uitoa_sloc1_1_0
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	sta	,x
;_itoa.c:28: if ( string[index] > '9') string[index] += 'A' - '9' - 1;
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc2_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(__uitoa_sloc2_1_0), 0)
	ldhx	*__uitoa_sloc2_1_0
	lda	,x
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genCmp	(>)
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	cmp	#0x39
; Peephole 2j	- eliminated bra
	ble	00102$
00117$:
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc2_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc2_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc2_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc1_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc1_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc1_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(__uitoa_sloc1_1_0), 0)
	ldhx	*__uitoa_sloc1_1_0
	lda	,x
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
; checking pset operandsEqu
;     genPlus
; IS_AOP_HX = 0
; icount = 7, sameRegs=1
;     genPlusIncr
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	add	#0x07
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genPointerSet
;     loadRegFromAop (hx, DIR(__uitoa_sloc2_1_0), 0)
	ldhx	*__uitoa_sloc2_1_0
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	sta	,x
00102$:
;_itoa.c:29: value /= radix;
;     genCast
;     loadRegFromAop (a, EXT(__uitoa_PARM_3), 0)
	lda	__uitoa_PARM_3
;     storeRegToAop (a, EXT(__divuint_PARM_2), 0), stacked=0, isaddr=1
	sta	(__divuint_PARM_2 + 1)
	clra
;     storeRegToAop (a, EXT(__divuint_PARM_2), 1), stacked=0, isaddr=1
	sta	__divuint_PARM_2
;     genCall
;     loadRegFromAop (x, EXT(__uitoa_value_1_1), 1)
	ldx	__uitoa_value_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(__uitoa_value_1_1), 0)
	lda	(__uitoa_value_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__divuint
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(__uitoa_value_1_1), 0), stacked=0, isaddr=0
	sta	(__uitoa_value_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(__uitoa_value_1_1), 1), stacked=0, isaddr=0
	stx	__uitoa_value_1_1
;_itoa.c:30: } while (value != 0);
;     genCmpEQorNE	(==)
;     loadRegFromAop (a, EXT(__uitoa_value_1_1), 0)
	lda	(__uitoa_value_1_1 + 1)
	cmp	#0x00
	bne	00118$
;     loadRegFromAop (a, EXT(__uitoa_value_1_1), 1)
	lda	__uitoa_value_1_1
	cmp	#0x00
	beq	00119$
00118$:
	jmp	00103$
00119$:
;_itoa.c:32: do {
;     genAssign
	clr	*__uitoa_sloc2_1_0
;     genAssign
	mov	*__uitoa_sloc0_1_0,*__uitoa_sloc1_1_0
00106$:
;_itoa.c:33: string[i++] = string[index++];
;     genAssign
	mov	*__uitoa_sloc2_1_0,*__uitoa_sloc0_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 1, sameRegs=1
;     genPlusIncr
	inc	*__uitoa_sloc2_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc3_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc3_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc3_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc3_1_0
;     genAssign
	mov	*__uitoa_sloc1_1_0,*__uitoa_sloc0_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
; icount = 1, sameRegs=1
;     genPlusIncr
	inc	*__uitoa_sloc1_1_0
; checking lic
; checking IS_ITEMP
; pset=0, pget=1
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc0_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc4_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc4_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc4_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc4_1_0
;     genPointerGet
;     loadRegFromAop (hx, DIR(__uitoa_sloc4_1_0), 0)
	ldhx	*__uitoa_sloc4_1_0
	lda	,x
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genPointerSet
;     loadRegFromAop (hx, DIR(__uitoa_sloc3_1_0), 0)
	ldhx	*__uitoa_sloc3_1_0
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	sta	,x
;_itoa.c:34: } while ( index < NUMBER_OF_DIGITS );
;     genCmp	(<)
;     loadRegFromAop (a, DIR(__uitoa_sloc1_1_0), 0)
	lda	*__uitoa_sloc1_1_0
	cmp	#0x10
; Peephole 2b	- eliminated jmp
	bcs	00106$
00120$:
;_itoa.c:36: string[i] = 0; /* string terminator */
; checking lic
; checking IS_ITEMP
; pset=1, pget=0
; checking pset operandsEqu
; checking pget operandsEqu
; checking IS_SYMOP
; checking !IS_TRUE_SYMOP
;     genPlus
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 0)
	lda	(__uitoa_PARM_2 + 1)
	add	*__uitoa_sloc2_1_0
;     storeRegToAop (a, DIR(__uitoa_sloc4_1_0), 0), stacked=0, isaddr=1
	sta	*(__uitoa_sloc4_1_0 + 1)
;     loadRegFromAop (a, EXT(__uitoa_PARM_2), 1)
	lda	__uitoa_PARM_2
	adc	#0x00
;     storeRegToAop (a, DIR(__uitoa_sloc4_1_0), 1), stacked=0, isaddr=1
	sta	*__uitoa_sloc4_1_0
;     genPointerSet
;     loadRegFromAop (hx, DIR(__uitoa_sloc4_1_0), 0)
	ldhx	*__uitoa_sloc4_1_0
;     loadRegFromAop (a, LIT(#0x00), 0)
	clra
	sta	,x
00109$:
	rts
;------------------------------------------------------------
;Allocation info for local variables in function '_itoa'
;------------------------------------------------------------
;sloc0                     Allocated with name '__itoa_sloc0_1_0'
;string                    Allocated with name '__itoa_PARM_2'
;radix                     Allocated with name '__itoa_PARM_3'
;value                     Allocated with name '__itoa_value_1_1'
;------------------------------------------------------------
;_itoa.c:39: void _itoa(int value, char* string, unsigned char radix)
;	-----------------------------------------
;	 function _itoa
;	-----------------------------------------
__itoa:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(__itoa_value_1_1), 0), stacked=0, isaddr=0
	sta	(__itoa_value_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(__itoa_value_1_1), 1), stacked=0, isaddr=0
	stx	__itoa_value_1_1
;_itoa.c:41: if (value < 0 && radix == 10) {
;     genCmp	(<)
;     loadRegFromAop (a, EXT(__itoa_value_1_1), 1)
	lda	__itoa_value_1_1
	sub	#0x00
; Peephole 2l	- eliminated bra
	bge	00102$
00108$:
;     genCmpEQorNE	(==)
;     loadRegFromAop (a, EXT(__itoa_PARM_3), 0)
	lda	__itoa_PARM_3
	cmp	#0x0A
; Peephole 2c	- eliminated jmp
	bne	00102$
00109$:
;_itoa.c:42: *string++ = '-';
;     genAssign
;     loadRegFromAop (a, EXT(__itoa_PARM_2), 1)
	lda	__itoa_PARM_2
;     storeRegToAop (a, DIR(__itoa_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*__itoa_sloc0_1_0
;     loadRegFromAop (a, EXT(__itoa_PARM_2), 0)
	lda	(__itoa_PARM_2 + 1)
;     storeRegToAop (a, DIR(__itoa_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(__itoa_sloc0_1_0 + 1)
;     genPointerSet
;     loadRegFromAop (hx, DIR(__itoa_sloc0_1_0), 0)
	ldhx	*__itoa_sloc0_1_0
;     loadRegFromAop (a, LIT(#0x2D), 0)
	lda	#0x2D
	sta	,x
; checking lic
; checking IS_ITEMP
;     genPlus
; IS_AOP_HX = 0
; icount = 1, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, DIR(__itoa_sloc0_1_0), 0)
	lda	*(__itoa_sloc0_1_0 + 1)
	add	#0x01
;     storeRegToAop (a, EXT(__itoa_PARM_2), 0), stacked=0, isaddr=1
	sta	(__itoa_PARM_2 + 1)
;     loadRegFromAop (a, DIR(__itoa_sloc0_1_0), 1)
	lda	*__itoa_sloc0_1_0
	adc	#0x00
;     storeRegToAop (a, EXT(__itoa_PARM_2), 1), stacked=0, isaddr=1
	sta	__itoa_PARM_2
;_itoa.c:43: value = -value;
;     genUminus
	clra
	sub	(__itoa_value_1_1 + 1)
;     storeRegToAop (a, EXT(__itoa_value_1_1), 0), stacked=0, isaddr=0
	sta	(__itoa_value_1_1 + 1)
	clra
	sbc	__itoa_value_1_1
;     storeRegToAop (a, EXT(__itoa_value_1_1), 1), stacked=0, isaddr=0
	sta	__itoa_value_1_1
00102$:
;_itoa.c:45: _uitoa(value, string, radix);
;     genAssign
;     loadRegFromAop (a, EXT(__itoa_PARM_2), 1)
	lda	__itoa_PARM_2
;     storeRegToAop (a, EXT(__uitoa_PARM_2), 1), stacked=0, isaddr=1
	sta	__uitoa_PARM_2
;     loadRegFromAop (a, EXT(__itoa_PARM_2), 0)
	lda	(__itoa_PARM_2 + 1)
;     storeRegToAop (a, EXT(__uitoa_PARM_2), 0), stacked=0, isaddr=1
	sta	(__uitoa_PARM_2 + 1)
;     genAssign
;     loadRegFromAop (a, EXT(__itoa_PARM_3), 0)
	lda	__itoa_PARM_3
;     storeRegToAop (a, EXT(__uitoa_PARM_3), 0), stacked=0, isaddr=1
	sta	__uitoa_PARM_3
;     genCall
;     loadRegFromAop (x, EXT(__itoa_value_1_1), 1)
	ldx	__itoa_value_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(__itoa_value_1_1), 0)
	lda	(__itoa_value_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__uitoa
00104$:
	rts
	.area CSEG (CODE)
	.area CONST   (CODE)
	.area XINIT
