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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [d10v/] [crt0.S] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 9... Line 9...
 
 
; R14 always contains memory base address (0)
; R14 always contains memory base address (0)
 
 
        ldi     r14,0
        ldi     r14,0
 
 
; Set the USER stack pointer.
; Set the USER and SYSTEM stack pointers.
 
 
        ldi     sp, 0x8000      ; SW
 
        mvtc    sp, psw         ; psw <- SW
 
        ldi     sp, _stack
 
        ldi     r0,0            ; zero arguments
        ldi     r0,0            ; zero arguments
        ldi     r1,0
        ldi     r1,0
 
        mvtc    r0, psw         ; select SPI and set it
 
        ldi     sp, _stack
 
        ldi     r10, 0x8000     ; select SPU/FP and set it
 
        mvtc r10, psw || ldi r11, 0;  clear stack frame
 
        ldi     sp, _stack - 0x200
 
        ldi     r13, 0
 
 
; Clear the BSS.  Do it in two parts for efficiency: longwords first
; Clear the BSS.  Do it in two parts for efficiency: longwords first
; for most of it, then the remaining 0 to 3 bytes.
; for most of it, then the remaining 0 to 3 bytes.
 
 
        ldi     r2, __bss_start ; R2 = start of BSS
        ldi     r2, __bss_start ; R2 = start of BSS
Line 42... Line 45...
        stb     r0, @r2         ; yep, zero out another byte
        stb     r0, @r2         ; yep, zero out another byte
        addi    r2, 1           ; bump address
        addi    r2, 1           ; bump address
        subi    r4, 1           ; decrement count
        subi    r4, 1           ; decrement count
        bra.s   loop2           ; go do some more
        bra.s   loop2           ; go do some more
endloop2:
endloop2:
 
 
; Call main, then stop simulator
; Call main, then stop simulator
 
        st r11, @-sp
 
        st r13, @-sp
 
        mv r11, sp
 
 
        bl      main
        bl      main
        bl      exit
        bl      exit
        stop
        stop
.Lstart:
.Lstart:

powered by: WebSVN 2.1.0

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