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

Subversion Repositories yacc

[/] [yacc/] [trunk/] [bench/] [c_src/] [plasmaboot.asm] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tak.sugawa
##################################################################
2
# TITLE: Boot Up Code
3
# AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
# DATE CREATED: 1/12/02
5
# FILENAME: boot.asm
6
# PROJECT: Plasma CPU core
7
# 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
   #These eight instructions must be the first instructions.
20
   #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
   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
$BSS_CLEAR:
31
   sw    $0,0($4)
32
   slt   $3,$4,$5
33
   bnez  $3,$BSS_CLEAR
34
   addiu $4,$4,4
35
 
36
   jal   main2
37
   nop
38
$L1:
39
   j $L1
40
 
41
   #address 0x3c
42
interrupt_service_routine:
43
   #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
 
48
   #normally clear the interrupt source here
49
 
50
   #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
 
58
 
59
###################################################
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
   .set reorder
67
   .end isr_enable
68
 
69
 
70
###################################################
71
        .globl  putchar
72
        .ent    putchar
73
putchar:
74
   .set noreorder
75
   li $5,0xffff
76
 
77
   #Uncomment to make each character on a seperate line
78
   #The VHDL simulator buffers the lines
79
#   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
###################################################
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.