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

;--------------------------------------------------------
	.module _strncpy
	
	.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 _strncpy_PARM_3
	.globl _strncpy_PARM_2
	.globl _strncpy
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area	OSEG    (OVR)
_strncpy_sloc0_1_0::
	.ds 2
_strncpy_sloc1_1_0::
	.ds 2
_strncpy_sloc2_1_0::
	.ds 2
_strncpy_sloc3_1_0::
	.ds 2
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_strncpy_PARM_2::
	.ds 2
_strncpy_PARM_3::
	.ds 2
_strncpy_d_1_1::
	.ds 2
_strncpy_d1_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 'strncpy'
;------------------------------------------------------------
;s                         Allocated with name '_strncpy_PARM_2'
;n                         Allocated with name '_strncpy_PARM_3'
;d                         Allocated with name '_strncpy_d_1_1'
;d1                        Allocated with name '_strncpy_d1_1_1'
;sloc0                     Allocated with name '_strncpy_sloc0_1_0'
;sloc1                     Allocated with name '_strncpy_sloc1_1_0'
;sloc2                     Allocated with name '_strncpy_sloc2_1_0'
;sloc3                     Allocated with name '_strncpy_sloc3_1_0'
;------------------------------------------------------------
;_strncpy.c:26: char *strncpy (
;	-----------------------------------------
;	 function strncpy
;	-----------------------------------------
_strncpy:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_strncpy_d_1_1), 0), stacked=0, isaddr=0
	sta	(_strncpy_d_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_strncpy_d_1_1), 1), stacked=0, isaddr=0
	stx	_strncpy_d_1_1
;_strncpy.c:31: register char * d1 =  d;
;     genAssign
;     loadRegFromAop (a, EXT(_strncpy_d_1_1), 0)
	lda	(_strncpy_d_1_1 + 1)
;     storeRegToAop (a, EXT(_strncpy_d1_1_1), 0), stacked=0, isaddr=0
	sta	(_strncpy_d1_1_1 + 1)
;     loadRegFromAop (a, EXT(_strncpy_d_1_1), 1)
	lda	_strncpy_d_1_1
;     storeRegToAop (a, EXT(_strncpy_d1_1_1), 1), stacked=0, isaddr=0
	sta	_strncpy_d1_1_1
;_strncpy.c:33: while ( n-- )
;     genAssign
;     loadRegFromAop (a, EXT(_strncpy_PARM_2), 0)
	lda	(_strncpy_PARM_2 + 1)
;     storeRegToAop (a, DIR(_strncpy_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_strncpy_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_strncpy_PARM_2), 1)
	lda	_strncpy_PARM_2
;     storeRegToAop (a, DIR(_strncpy_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_strncpy_sloc0_1_0
;     genAssign
;     loadRegFromAop (a, EXT(_strncpy_d_1_1), 0)
	lda	(_strncpy_d_1_1 + 1)
;     storeRegToAop (a, DIR(_strncpy_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_strncpy_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_strncpy_d_1_1), 1)
	lda	_strncpy_d_1_1
;     storeRegToAop (a, DIR(_strncpy_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_strncpy_sloc1_1_0
;     genAssign
;     loadRegFromAop (a, EXT(_strncpy_PARM_3), 0)
	lda	(_strncpy_PARM_3 + 1)
;     storeRegToAop (a, DIR(_strncpy_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_strncpy_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_strncpy_PARM_3), 1)
	lda	_strncpy_PARM_3
;     storeRegToAop (a, DIR(_strncpy_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_strncpy_sloc2_1_0
00101$:
;     genAssign
	mov	*(_strncpy_sloc2_1_0 + 1),*(_strncpy_sloc3_1_0 + 1)
	mov	*_strncpy_sloc2_1_0,*_strncpy_sloc3_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_strncpy_sloc2_1_0), 0)
	lda	*(_strncpy_sloc2_1_0 + 1)
	sub	#0x01
;     storeRegToAop (a, DIR(_strncpy_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_strncpy_sloc2_1_0 + 1)
;     loadRegFromAop (a, DIR(_strncpy_sloc2_1_0), 1)
	lda	*_strncpy_sloc2_1_0
	sbc	#0x00
;     storeRegToAop (a, DIR(_strncpy_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_strncpy_sloc2_1_0
;     genIfx
;     loadRegFromAop (a, DIR(_strncpy_sloc3_1_0), 0)
	lda	*(_strncpy_sloc3_1_0 + 1)
	ora	*_strncpy_sloc3_1_0
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00103$
00108$:
;_strncpy.c:34: *d++ = *s++ ;
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_strncpy_sloc0_1_0), 0)
	ldhx	*_strncpy_sloc0_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_strncpy_sloc3_1_0), 0), stacked=0, isaddr=0
	sta	*_strncpy_sloc3_1_0
;     storeRegToAop (hx, DIR(_strncpy_sloc0_1_0), 0), stacked=0, isaddr=0
	sthx	*_strncpy_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_strncpy_sloc1_1_0), 0)
	ldhx	*_strncpy_sloc1_1_0
;     loadRegFromAop (a, DIR(_strncpy_sloc3_1_0), 0)
	lda	*_strncpy_sloc3_1_0
	sta	,x
	aix	#1
;     storeRegToAop (hx, DIR(_strncpy_sloc1_1_0), 0), stacked=0, isaddr=0
	sthx	*_strncpy_sloc1_1_0
; Peephole 3	- shortened jmp to bra
	bra	00101$
00103$:
;_strncpy.c:35: return d1;
;     genRet
;     loadRegFromAop (x, EXT(_strncpy_d1_1_1), 1)
	ldx	_strncpy_d1_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_strncpy_d1_1_1), 0)
	lda	(_strncpy_d1_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00104$:
	rts
	.area CSEG
	.area XINIT
