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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [disk/] [tools/] [mkmboot/] [stage2/] [c0.s] - Blame information for rev 279

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

Line No. Rev Author Line
1 17 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
        .import entryPoint
19
 
20
        .code
21
_bcode:
22
 
23
start:
24
        add     $10,$0,_bdata            ; copy data segment
25
        add     $8,$0,_edata
26
        sub     $9,$8,$10
27
        add     $9,$9,_ecode
28
        j       cpytest
29
cpyloop:
30
        ldw     $11,$9,0
31
        stw     $11,$8,0
32
cpytest:
33
        sub     $8,$8,4
34
        sub     $9,$9,4
35
        bgeu    $8,$10,cpyloop
36
        add     $8,$0,_bbss              ; clear bss segment
37
        add     $9,$0,_ebss
38
        j       clrtest
39
clrloop:
40
        stw     $0,$8,0
41
        add     $8,$8,4
42
clrtest:
43
        bltu    $8,$9,clrloop
44 86 hellwig
        add     $29,$0,0xC0020000        ; setup stack
45 17 hellwig
        stw     $16,$0,bootDisk          ; make arguments available
46
        stw     $17,$0,startSector
47
        stw     $18,$0,numSectors
48
        jal     main                    ; call 'main' function
49
        ldw     $16,$0,bootDisk          ; setup arguments for next stage
50
        ldw     $17,$0,startSector
51
        ldw     $18,$0,numSectors
52
        ldw     $31,$0,entryPoint        ; jump to loaded program
53
        jr      $31
54
 
55
        .data
56
_bdata:
57
 
58
        .bss
59
_bbss:

powered by: WebSVN 2.1.0

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