URL
https://opencores.org/ocsvn/plasma/plasma/trunk
[/] [plasma/] [tags/] [V2_1/] [tools/] [boot.asm] - Diff between revs 20 and 28
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 20 |
Rev 28 |
Line 14... |
Line 14... |
.globl entry
|
.globl entry
|
.ent entry
|
.ent entry
|
entry:
|
entry:
|
.set noreorder
|
.set noreorder
|
|
|
ori $sp,$0,0x8000 #initialize stack pointer
|
#These eight instructions must be the first instructions
|
ori $4,$0,1
|
#convert.exe will correctly initialize $gp
|
mtc0 $4,$12 #STATUS=1; enable interrupts
|
lui $gp,0
|
|
ori $gp,$gp,0
|
|
#convert.exe will set $4=.sbss_start $5=.bss_end
|
|
ori $4,$0,0
|
|
ori $5,$0,0
|
|
$BSS_CLEAR:
|
|
sw $0,0($4)
|
|
slt $3,$4,$5
|
|
bnez $3,$BSS_CLEAR
|
|
addiu $4,$4,4
|
|
|
|
ori $sp,$0,0xfff0 #initialize stack pointer
|
jal main2
|
jal main2
|
nop
|
nop
|
$L1:
|
$L1:
|
j $L1
|
j $L1
|
nop
|
|
nop
|
|
|
|
isr_storage: #address 0x20
|
|
nop
|
|
nop
|
|
nop
|
|
nop
|
|
|
|
#address 0x30
|
#address 0x30
|
interrupt_service_routine:
|
interrupt_service_routine:
|
sw $4,-4($sp)
|
#registers $26 and $27 are reserved for the OS
|
|
ori $26,$0,0xffff
|
sw $5,-8($sp)
|
ori $27,$0,46
|
ori $5,$0,0xffff
|
sb $27,0($26) #echo out '.'
|
ori $4,$0,46
|
|
sb $4,0($5) #echo out '.'
|
|
lw $5,-8($sp)
|
|
|
|
#normally clear the interrupt source here
|
#normally clear the interrupt source here
|
#re-enable interrupts
|
|
ori $4,$0,0x1
|
#return and re-enable interrupts
|
|
ori $26,$0,0x1
|
|
mfc0 $27,$14 #C0_EPC=14
|
|
jr $27
|
|
mtc0 $26,$12 #STATUS=1; enable interrupts
|
|
.set reorder
|
|
.end entry
|
|
|
|
|
|
###################################################
|
|
.globl isr_enable
|
|
.ent isr_enable
|
|
isr_enable:
|
|
.set noreorder
|
|
jr $31
|
mtc0 $4,$12 #STATUS=1; enable interrupts
|
mtc0 $4,$12 #STATUS=1; enable interrupts
|
|
.set reorder
|
|
.end isr_enable
|
|
|
|
|
#FIXME there is a small race condition here!
|
###################################################
|
|
.globl putchar
|
|
.ent putchar
|
|
putchar:
|
|
.set noreorder
|
|
li $5,0xffff
|
|
|
mfc0 $4,$14 #C0_EPC=14
|
#uncomment to make each character on a seperate line
|
j $4
|
# sb $4,0($5)
|
lw $4,-4($sp)
|
# ori $4,$0,'\n'
|
|
|
|
jr $31
|
|
sb $4,0($5)
|
.set reorder
|
.set reorder
|
.end entry
|
.end putchar
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.