source: rtems/c/src/lib/libbsp/m32r/m32rsim/start/start.S @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  From Newlib 1.16.0
3 */
4
5        .text
6        .balign 4
7        .global _start
8_start:
9
10        seth    sp, #shigh(_stack)
11        add3    sp, sp, #low(_stack)
12        ldi     fp, #0
13
14# Clear the BSS.  Do it in two parts for efficiency: longwords first
15# for most of it, then the remaining 0 to 3 bytes.
16
17        seth    r2, #shigh(__bss_start)
18        add3    r2, r2, #low(__bss_start); R2 = start of BSS
19        seth    r3, #shigh(_end)
20        add3    r3, r3, #low(_end)      ; R3 = end of BSS + 1
21
22        sub     r3, r2          ; R3 = BSS size in bytes
23        mv      r4, r3
24        srli    r4, #2          ; R4 = BSS size in longwords (rounded down)
25        ldi     r1, #0          ; clear R1 for longword store
26        addi    r2, #-4         ; account for pre-inc store
27        beqz    r4, .Lendloop1  ; any more to go?
28.Lloop1:
29        st      r1, @+r2        ; yep, zero out another longword
30        addi    r4, #-1         ; decrement count
31        bnez    r4, .Lloop1     ; go do some more
32.Lendloop1:
33        and3    r4, r3, #3      ; get no. of remaining BSS bytes to clear
34        addi    r2, #4          ; account for pre-inc store
35        beqz    r4, .Lendloop2  ; any more to go?
36.Lloop2:
37        stb     r1, @r2         ; yep, zero out another byte
38        addi    r2, #1          ; bump address
39        addi    r4, #-1         ; decrement count
40        bnez    r4, .Lloop2     ; go do some more
41.Lendloop2:
42
43# Run code in the .init section.
44# This will queue the .fini section to be run with atexit.
45
46        # bl    __init
47
48# Call main, then exit.
49
50        ldi     r1, #0           ; r1 = argv
51        ldi     r0, #0           ; r0 = argc
52        bl      boot_card
53
54# If that fails just loop.
55
56.Lexit:
57        bra     .Lexit
Note: See TracBrowser for help on using the repository browser.