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

Subversion Repositories or1k

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

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
        .section .text
12
        .align 2
13
        .global _strcmp
14
_strcmp:
15
        MOVP    A0P,A2P
16
        MOVP    A1P,A3P
17
.L5:
18
        mov.b   @A2P+,A1L
19
        beq     .L3
20
        mov.b   @A3P+,A0L
21
        cmp.b   A0L,A1L
22
        beq     .L5
23
        subs    #1,A3P
24
.L3:
25
        mov.b   @(-1,A2P),A0L
26
        mov.b   @A3P,A1L
27
        sub.b   A1L,A0L
28
        ; We have to sign extend the result to 32bits just in case
29
        ; we are using 32bit integers.
30
#ifdef __H8300H__
31
        exts.w  r0
32
        exts.l  er0
33
#else
34
#ifdef __H8300S__
35
        exts.w  r0
36
        exts.l  er0
37
#else
38
        bld     #7,r0l
39
        subx    r0h,r0h
40
        subx    r1l,r1l
41
        subx    r1h,r1h
42
#endif
43
#endif
44
        rts
45
        .end

powered by: WebSVN 2.1.0

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