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

Subversion Repositories plasma

[/] [plasma/] [tags/] [V2_1/] [tools/] [boot.asm] - Blame information for rev 110

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

Line No. Rev Author Line
1 20 rhoads
##################################################################
2
# TITLE: Boot Up Code
3
# AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
# DATE CREATED: 1/12/02
5
# FILENAME: boot.asm
6 43 rhoads
# PROJECT: Plasma CPU core
7 20 rhoads
# COPYRIGHT: Software placed into the public domain by the author.
8
#    Software 'as is' without warranty.  Author liable for nothing.
9
# DESCRIPTION:
10
#    Initializes the stack pointer and jumps to main2().
11
##################################################################
12
        .text
13
        .align  2
14
        .globl  entry
15
        .ent    entry
16
entry:
17
   .set noreorder
18
 
19 110 rhoads
   #These eight instructions must be the first instructions.
20 28 rhoads
   #convert.exe will correctly initialize $gp
21
   lui   $gp,0
22
   ori   $gp,$gp,0
23
   #convert.exe will set $4=.sbss_start $5=.bss_end
24 110 rhoads
   lui   $4,0
25
   ori   $4,$4,0
26
   lui   $5,0
27
   ori   $5,$5,0
28
   lui   $sp,0
29
   ori   $sp,$sp,0xfff0     #initialize stack pointer
30 28 rhoads
$BSS_CLEAR:
31
   sw    $0,0($4)
32
   slt   $3,$4,$5
33
   bnez  $3,$BSS_CLEAR
34
   addiu $4,$4,4
35
 
36 47 rhoads
   jal   main2
37 20 rhoads
   nop
38
$L1:
39
   j $L1
40
 
41 110 rhoads
   #address 0x3c
42 20 rhoads
interrupt_service_routine:
43 28 rhoads
   #registers $26 and $27 are reserved for the OS
44
   ori $26,$0,0xffff
45
   ori $27,$0,46
46
   sb $27,0($26)           #echo out '.'
47 20 rhoads
 
48
   #normally clear the interrupt source here
49
 
50 28 rhoads
   #return and re-enable interrupts
51
   ori $26,$0,0x1
52
   mfc0 $27,$14      #C0_EPC=14
53
   jr $27
54
   mtc0 $26,$12      #STATUS=1; enable interrupts
55
   .set reorder
56
        .end    entry
57 20 rhoads
 
58
 
59 28 rhoads
###################################################
60
   .globl isr_enable
61
   .ent isr_enable
62
isr_enable:
63
   .set noreorder
64
   jr $31
65
   mtc0  $4,$12            #STATUS=1; enable interrupts
66 20 rhoads
   .set reorder
67 28 rhoads
   .end isr_enable
68 20 rhoads
 
69 28 rhoads
 
70
###################################################
71
        .globl  putchar
72
        .ent    putchar
73
putchar:
74
   .set noreorder
75
   li $5,0xffff
76
 
77 37 rhoads
   #Uncomment to make each character on a seperate line
78
   #The VHDL simulator buffers the lines
79 28 rhoads
#   sb $4,0($5)
80
#   ori $4,$0,'\n'
81
 
82
   jr $31
83
   sb $4,0($5)
84
   .set reorder
85
   .end putchar
86
 
87
 
88 37 rhoads
###################################################
89
        .globl  puts
90
        .ent    puts
91
puts:
92
   .set noreorder
93
   ori $5,$0,0xffff
94
PUTS1:
95
   lb $6,0($4)
96
   beqz $6,PUTS2
97
   addiu $4,$4,1
98
   b PUTS1
99
   sb $6,0($5)
100
PUTS2:
101
   jr $31
102
   ori $2,$0,0
103
   .set reorder
104
   .end puts
105
 
106
 

powered by: WebSVN 2.1.0

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