source: trunk/libs/newlib/src/newlib/libc/machine/rx/strcmp.S @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 673 bytes
Line 
1        .file   "strcmp.S"
2
3        .section .text
4       
5        .global  _strcmp
6        .type    _strcmp,@function
7_strcmp:
8#ifdef __RX_DISALLOW_STRING_INSNS__
92:      mov.b   [r1+], r4
10        mov.b   [r2+], r5
11        cmp     #0, r4
12        beq     3f
13        cmp     #0, r5
14        beq     3f
15        cmp     r4, r5
16        beq     2b
17
183:      and     #0xff, r4       ; We need to perform an unsigned comparison of the bytes.
19        and     #0xff, r5
20        sub     r5, r4, r1
21        rts
22#else
23        mov     #-1, r3         ; Strictly speaking this is incorrect, but I doubt if anyone will ever know.
24        scmpu                   ; Perform the string comparison
25        bnc     1f              ; If Carry is not set skip over
26        scne.L  r1              ; Set result based on Z flag
27        rts                     ;
281:                              ;
29        mov     #-1,r1          ; Carry not set, result should be negative
30        rts                     ;
31#endif
32        .size _strcmp, . - _strcmp
33       
Note: See TracBrowser for help on using the repository browser.