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

;--------------------------------------------------------
	.module _strchr
	
	.area CSEG
	.area GSINIT
	.area GSFINAL
	.area XINIT
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _strchr_PARM_2
	.globl _strchr
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area	OSEG    (OVR)
_strchr_sloc0_1_0::
	.ds 2
_strchr_sloc1_1_0::
	.ds 1
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_strchr_PARM_2::
	.ds 1
_strchr_string_1_1::
	.ds 2
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT
	.area GSFINAL
	.area GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME
	.area CSEG
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG
;------------------------------------------------------------
;Allocation info for local variables in function 'strchr'
;------------------------------------------------------------
;ch                        Allocated with name '_strchr_PARM_2'
;string                    Allocated with name '_strchr_string_1_1'
;sloc0                     Allocated with name '_strchr_sloc0_1_0'
;sloc1                     Allocated with name '_strchr_sloc1_1_0'
;------------------------------------------------------------
;_strchr.c:26: char * strchr (
;	-----------------------------------------
;	 function strchr
;	-----------------------------------------
_strchr:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_strchr_string_1_1), 0), stacked=0, isaddr=0
	sta	(_strchr_string_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_strchr_string_1_1), 1), stacked=0, isaddr=0
	stx	_strchr_string_1_1
;_strchr.c:31: while (*string && *string != ch)
;     genAssign
;     loadRegFromAop (a, EXT(_strchr_string_1_1), 0)
	lda	(_strchr_string_1_1 + 1)
;     storeRegToAop (a, DIR(_strchr_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_strchr_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_strchr_string_1_1), 1)
	lda	_strchr_string_1_1
;     storeRegToAop (a, DIR(_strchr_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_strchr_sloc0_1_0
00102$:
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_strchr_sloc0_1_0), 0)
	ldhx	*_strchr_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_strchr_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*_strchr_sloc1_1_0
;     genIfx
	tst	*_strchr_sloc1_1_0
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00104$
00113$:
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_strchr_sloc0_1_0), 0)
	ldhx	*_strchr_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_strchr_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*_strchr_sloc1_1_0
;     genCmpEq
;     loadRegFromAop (a, DIR(_strchr_sloc1_1_0), 0)
	lda	*_strchr_sloc1_1_0
	cmp	_strchr_PARM_2
; Peephole 2d	- eliminated jmp
	beq	00104$
00114$:
;_strchr.c:32: string++;
; checking lic
; checking IS_ITEMP
; pset=0, pget=0
;     genPlus
; IS_AOP_HX = 0
;     loadRegFromAop (hx, DIR(_strchr_sloc0_1_0), 0)
	ldhx	*_strchr_sloc0_1_0
	aix	#1
;     storeRegToAop (hx, DIR(_strchr_sloc0_1_0), 0), stacked=0, isaddr=0
	sthx	*_strchr_sloc0_1_0
; Peephole 3	- shortened jmp to bra
	bra	00102$
00104$:
;_strchr.c:34: if (*string == ch)
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_strchr_sloc0_1_0), 0)
	ldhx	*_strchr_sloc0_1_0
	lda	,x
;     storeRegToAop (a, DIR(_strchr_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*_strchr_sloc1_1_0
;     genCmpEq
;     loadRegFromAop (a, DIR(_strchr_sloc1_1_0), 0)
	lda	*_strchr_sloc1_1_0
	cmp	_strchr_PARM_2
	bne	00115$
	bra	00116$
00115$:
; Peephole 3	- shortened jmp to bra
	bra	00106$
00116$:
;_strchr.c:35: return(string);
;     genRet
;     loadRegFromAop (x, DIR(_strchr_sloc0_1_0), 1)
	ldx	*_strchr_sloc0_1_0
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(_strchr_sloc0_1_0), 0)
	lda	*(_strchr_sloc0_1_0 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; Peephole 3	- shortened jmp to bra
	bra	00107$
00106$:
;_strchr.c:36: return ( NULL );
;     genRet
;     loadRegFromAop (x, LIT(#0x00), 1)
	ldx	#0x00
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, LIT(#0x00), 0)
	lda	#0x00
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00107$:
	rts
	.area CSEG
	.area XINIT
