OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [machine/] [h8300/] [reg_memcpy.S] - Blame information for rev 1007

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1007 ivang
#include "defines.h"
2
 
3
#ifdef __H8300H__
4
        .h8300h
5
#endif
6
 
7
#ifdef __H8300S__
8
        .h8300s
9
#endif
10
 
11
 
12
        ; dst A0
13
        ; src A1
14
        ; len A2
15
        .global ___reg_memcpy
16
___reg_memcpy:
17
 
18
        MOVP    A0P,A3P ; keep copy of result
19
        ADDP    A2P,A0P ; point to end of dst
20
        ADDP    A2P,A1P ; point to end of src
21
        CMPP    A0P,A3P ; see if anything to do
22
        beq     quit
23
 
24
 
25
loop:   subs    #1,A1P          ; point to byte
26
        mov.b   @A1P,A2L        ; get byte
27
        mov.b   A2L,@-A0P       ; save byte
28
        CMPP    A0P,A3P         ; at the front again ?
29
        bne     loop
30
 
31
        ; return with A0 pointing to dst
32
quit:   rts
33
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.