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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [stdalone/] [mkpart/] [mkmboot/] [stage2/] [c0.s] - Blame information for rev 48

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 hellwig
;
2
; c0.s -- startup code and begin-of-segment labels
3
;
4
 
5
        .import main
6
 
7
        .import _ecode
8
        .import _edata
9
        .import _ebss
10
 
11
        .export _bcode
12
        .export _bdata
13
        .export _bbss
14
 
15
        .import bootDisk
16
        .import startSector
17
        .import numSectors
18
 
19
        .code
20
_bcode:
21
 
22
start:
23
        add     $10,$0,_bdata            ; copy data segment
24
        add     $8,$0,_edata
25
        sub     $9,$8,$10
26
        add     $9,$9,_ecode
27
        j       cpytest
28
cpyloop:
29
        ldw     $11,$9,0
30
        stw     $11,$8,0
31
cpytest:
32
        sub     $8,$8,4
33
        sub     $9,$9,4
34
        bgeu    $8,$10,cpyloop
35
        add     $8,$0,_bbss              ; clear bss segment
36
        add     $9,$0,_ebss
37
        j       clrtest
38
clrloop:
39
        stw     $0,$8,0
40
        add     $8,$8,4
41
clrtest:
42
        bltu    $8,$9,clrloop
43
        add     $29,$0,0xC0100000        ; setup stack
44
        stw     $16,$0,bootDisk          ; make arguments available
45
        stw     $17,$0,startSector
46
        stw     $18,$0,numSectors
47
        jal     main                    ; call 'main' function
48
        ldw     $16,$0,bootDisk          ; setup arguments for next stage
49
        ldw     $17,$0,startSector
50
        ldw     $18,$0,numSectors
51
        add     $31,$0,0xC0000000        ; jump to loaded program
52
        jr      $31
53
 
54
        .data
55
_bdata:
56
 
57
        .bss
58
_bbss:

powered by: WebSVN 2.1.0

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