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

;--------------------------------------------------------
	.module _memcpy
	
	.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 _memcpy_PARM_3
	.globl _memcpy_PARM_2
	.globl _memcpy
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area	OSEG    (OVR)
_memcpy_sloc0_1_0::
	.ds 2
_memcpy_sloc1_1_0::
	.ds 2
_memcpy_sloc2_1_0::
	.ds 2
_memcpy_sloc3_1_0::
	.ds 2
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_memcpy_PARM_2::
	.ds 2
_memcpy_PARM_3::
	.ds 2
_memcpy_dst_1_1::
	.ds 2
_memcpy_ret_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 'memcpy'
;------------------------------------------------------------
;src                       Allocated with name '_memcpy_PARM_2'
;acount                    Allocated with name '_memcpy_PARM_3'
;dst                       Allocated with name '_memcpy_dst_1_1'
;ret                       Allocated with name '_memcpy_ret_1_1'
;d                         Allocated to registers 
;s                         Allocated to registers 
;sloc0                     Allocated with name '_memcpy_sloc0_1_0'
;sloc1                     Allocated with name '_memcpy_sloc1_1_0'
;sloc2                     Allocated with name '_memcpy_sloc2_1_0'
;sloc3                     Allocated with name '_memcpy_sloc3_1_0'
;------------------------------------------------------------
;_memcpy.c:29: void * memcpy (
;	-----------------------------------------
;	 function memcpy
;	-----------------------------------------
_memcpy:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(_memcpy_dst_1_1), 0), stacked=0, isaddr=0
	sta	(_memcpy_dst_1_1 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(_memcpy_dst_1_1), 1), stacked=0, isaddr=0
	stx	_memcpy_dst_1_1
;_memcpy.c:61: void * ret = dst;
;     genAssign
;     loadRegFromAop (a, EXT(_memcpy_dst_1_1), 0)
	lda	(_memcpy_dst_1_1 + 1)
;     storeRegToAop (a, EXT(_memcpy_ret_1_1), 0), stacked=0, isaddr=0
	sta	(_memcpy_ret_1_1 + 1)
;     loadRegFromAop (a, EXT(_memcpy_dst_1_1), 1)
	lda	_memcpy_dst_1_1
;     storeRegToAop (a, EXT(_memcpy_ret_1_1), 1), stacked=0, isaddr=0
	sta	_memcpy_ret_1_1
;_memcpy.c:63: char * s = src;
;     genAssign
;_memcpy.c:68: while (acount--) {
;     genAssign
;     loadRegFromAop (a, EXT(_memcpy_PARM_2), 0)
	lda	(_memcpy_PARM_2 + 1)
;     storeRegToAop (a, DIR(_memcpy_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_memcpy_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(_memcpy_PARM_2), 1)
	lda	_memcpy_PARM_2
;     storeRegToAop (a, DIR(_memcpy_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*_memcpy_sloc0_1_0
;     genAssign
;     loadRegFromAop (a, EXT(_memcpy_dst_1_1), 0)
	lda	(_memcpy_dst_1_1 + 1)
;     storeRegToAop (a, DIR(_memcpy_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(_memcpy_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(_memcpy_dst_1_1), 1)
	lda	_memcpy_dst_1_1
;     storeRegToAop (a, DIR(_memcpy_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*_memcpy_sloc1_1_0
;     genAssign
;     loadRegFromAop (a, EXT(_memcpy_PARM_3), 0)
	lda	(_memcpy_PARM_3 + 1)
;     storeRegToAop (a, DIR(_memcpy_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_memcpy_sloc2_1_0 + 1)
;     loadRegFromAop (a, EXT(_memcpy_PARM_3), 1)
	lda	_memcpy_PARM_3
;     storeRegToAop (a, DIR(_memcpy_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_memcpy_sloc2_1_0
00101$:
;     genAssign
	mov	*(_memcpy_sloc2_1_0 + 1),*(_memcpy_sloc3_1_0 + 1)
	mov	*_memcpy_sloc2_1_0,*_memcpy_sloc3_1_0
;     genMinus
;     loadRegFromAop (a, DIR(_memcpy_sloc2_1_0), 0)
	lda	*(_memcpy_sloc2_1_0 + 1)
	sub	#0x01
;     storeRegToAop (a, DIR(_memcpy_sloc2_1_0), 0), stacked=0, isaddr=0
	sta	*(_memcpy_sloc2_1_0 + 1)
;     loadRegFromAop (a, DIR(_memcpy_sloc2_1_0), 1)
	lda	*_memcpy_sloc2_1_0
	sbc	#0x00
;     storeRegToAop (a, DIR(_memcpy_sloc2_1_0), 1), stacked=0, isaddr=0
	sta	*_memcpy_sloc2_1_0
;     genIfx
;     loadRegFromAop (a, DIR(_memcpy_sloc3_1_0), 0)
	lda	*(_memcpy_sloc3_1_0 + 1)
	ora	*_memcpy_sloc3_1_0
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00103$
00108$:
;_memcpy.c:69: *d++ = *s++;
;     genPointerGet
;     genFarPointerGet
;     loadRegFromAop (hx, DIR(_memcpy_sloc0_1_0), 0)
	ldhx	*_memcpy_sloc0_1_0
	lda	,x
	aix	#1
;     storeRegToAop (a, DIR(_memcpy_sloc3_1_0), 0), stacked=0, isaddr=0
	sta	*_memcpy_sloc3_1_0
;     storeRegToAop (hx, DIR(_memcpy_sloc0_1_0), 0), stacked=0, isaddr=0
	sthx	*_memcpy_sloc0_1_0
;     genPointerSet
;     genFarPointerSet
;     loadRegFromAop (hx, DIR(_memcpy_sloc1_1_0), 0)
	ldhx	*_memcpy_sloc1_1_0
;     loadRegFromAop (a, DIR(_memcpy_sloc3_1_0), 0)
	lda	*_memcpy_sloc3_1_0
	sta	,x
	aix	#1
;     storeRegToAop (hx, DIR(_memcpy_sloc1_1_0), 0), stacked=0, isaddr=0
	sthx	*_memcpy_sloc1_1_0
; Peephole 3	- shortened jmp to bra
	bra	00101$
00103$:
;_memcpy.c:72: return(ret);
;     genRet
;     loadRegFromAop (x, EXT(_memcpy_ret_1_1), 1)
	ldx	_memcpy_ret_1_1
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(_memcpy_ret_1_1), 0)
	lda	(_memcpy_ret_1_1 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00104$:
	rts
	.area CSEG
	.area XINIT
