1#------------------------------------------------------------------------------ 2# 3# Copyright (c) 2011-2014, ARM Limited. All rights reserved. 4# 5# This program and the accompanying materials 6# are licensed and made available under the terms and conditions of the BSD License 7# which accompanies this distribution. The full text of the license may be found at 8# http://opensource.org/licenses/bsd-license.php 9# 10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12# 13#------------------------------------------------------------------------------ 14 15#include <AsmMacroIoLib.h> 16 17# VOID 18# EFIAPI 19# memmove ( 20# IN VOID *Destination, 21# IN CONST VOID *Source, 22# IN UINT32 Size 23# ); 24ASM_FUNC(memmove) 25 CMP r2, #0 26 BXEQ lr 27 CMP r0, r1 28 BXEQ lr 29 BHI memmove_backward 30 31memmove_forward: 32 LDRB r3, [r1], #1 33 STRB r3, [r0], #1 34 SUBS r2, r2, #1 35 BXEQ lr 36 B memmove_forward 37 38memmove_backward: 39 add r0, r2 40 add r1, r2 41memmove_backward_loop: 42 LDRB r3, [r1, #-1]! 43 STRB r3, [r0, #-1]! 44 SUBS r2, r2, #1 45 BXEQ lr 46 B memmove_backward_loop 47