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

Subversion Repositories or1k

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

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
; A0P pointer to cursor
13
; A1P thing to copy
14
        .global _memset
15
 
16
_memset:
17
 
18
;       MOVP    @(2/4,r7),A2P   ; dst
19
;       MOVP    @(4/8,r7),A1    ; src thing
20
;       MOVP    @(6/12,r7),A3P  ; len
21
 
22
        MOVP    A2P,A2P
23
        beq     quit
24
 
25
        ; A3 points to the end of the area
26
        MOVP    A0P,A3P
27
        ADDP    A2P,A3P
28
 
29
        ; see if we can do it in words
30
        ; by oring in the start of the buffer to the end address
31
 
32
        or      A0L,A2L
33
        btst    #0,A2L
34
        bne     byteloop
35
 
36
        ; we can do it a word at a time
37
 
38
        mov.b   A1L,A1H
39
 
40
wordloop:
41
        mov.w   A1,@-A3P
42
        CMPP    A3P,A0P
43
        bne     wordloop
44
quit:   rts
45
 
46
byteloop:
47
        mov.b   A1L,@-A3P
48
        CMPP    A3P,A0P
49
        bne     byteloop
50
        rts
51
 

powered by: WebSVN 2.1.0

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