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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [simtest/] [disk/] [mkmbr/] [mbr.s] - Blame information for rev 200

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

Line No. Rev Author Line
1 9 hellwig
;
2
; mbr.s -- the master boot record
3
;
4
 
5
; $8  I/O base address
6
; $9  temporary value
7
; $10 character
8
; $11 pointer to string
9
; $29 stack pointer
10
; $31 return address
11
 
12
        .set    tba,0xF0300000  ; terminal base address
13
 
14
start:
15
        sub     $29,$29,4       ; save return register
16
        stw     $31,$29,0
17
        add     $8,$0,tba        ; set I/O base address
18
        add     $11,$0,msg       ; pointer to string
19
loop:
20
        ldbu    $10,$11,0        ; get char
21
        beq     $10,$0,stop      ; null - finished
22
        jal     out             ; output char
23
        add     $11,$11,1       ; bump pointer
24
        j       loop            ; next char
25
stop:
26
        ldw     $31,$29,0        ; restore return register
27
        add     $29,$29,4
28
        jr      $31             ; return
29
 
30
out:
31
        ldw     $9,$8,8         ; get status
32
        and     $9,$9,1         ; xmtr ready?
33
        beq     $9,$0,out        ; no - wait
34
        stw     $10,$8,12       ; send char
35
        jr      $31             ; return
36
 
37
msg:
38
        .byte   0x0D, 0x0A
39
        .byte   "Error: This is the default MBR, "
40
        .byte   "which cannot load anything."
41
        .byte   0x0D, 0x0A
42
        .byte   "Please replace the disk, or "
43
        .byte   "write an operating system onto it."
44
        .byte   0x0D, 0x0A
45
        .byte   0x0D, 0x0A, 0
46
 
47
        .locate 512-2
48
sign:
49
        .byte   0x55, 0xAA

powered by: WebSVN 2.1.0

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