;
; Copyright (c) Microsoft Corporation.  All rights reserved.
;
;
; Use of this sample source code is subject to the terms of the Microsoft
; license agreement under which you licensed this sample source code. If
; you did not accept the terms of the license agreement, you are not
; authorized to use this sample source code. For the terms of the license,
; please see the license agreement between you and Microsoft or, if applicable,
; see the LICENSE.RTF on your install media or the root of your tools installation.
; THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
;
;------------------------------------------------------------------------------
;

	INCLUDE kxarm.h
	INCLUDE armmacros.s

	TEXTAREA

    EXPORT    BurstCopy
    
	LEAF_ENTRY BurstCopy
	
		; r0 : Destination Address
		; r1 : Source Address
		; r2 : Size
		stmdb	r13!,{r0-r2,r5-r10,lr}
		mov		r9, r2
		mov		r2, r2, LSR #4
		mov		r10, r2, LSL #4
		sub		r9, r9, r10
				
loop4	ldmia	r1!,{r5-r8}					; 
		stmia	r0!,{r5-r8}					; 
		subs	r2,r2,#0x1						; Count decrement
		bne		loop4	 

		tst		r9, #0xF
		beq		last

loopn	ldr		r5, [r1, #0x4]!
		str		r5, [r0, #0x4]!
		subs	r9, r9, #0x1
		bne		loopn

last
		ldmia	r13!,{r0-r2,r5-r10,pc}

	ENTRY_END BurstCopy

;------------------------------------------------------------------------------

	END

