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

Subversion Repositories mlite

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 129 to Rev 130
    Reverse comparison

Rev 129 → Rev 130

/trunk/tools/boot.asm
18,20 → 18,20
 
#These eight instructions must be the first instructions.
#convert.exe will correctly initialize $gp
lui $gp,0
ori $gp,$gp,0
lui $gp, 0
ori $gp, $gp, 0
#convert.exe will set $4=.sbss_start $5=.bss_end
lui $4,0
ori $4,$4,0
lui $5,0
ori $5,$5,0
lui $sp,0
ori $sp,$sp,0xfff0 #initialize stack pointer
lui $4, 0
ori $4, $4, 0
lui $5, 0
ori $5, $5, 0
lui $sp, 0
ori $sp, $sp, 0xfff0 #initialize stack pointer
$BSS_CLEAR:
sw $0,0($4)
slt $3,$4,$5
bnez $3,$BSS_CLEAR
addiu $4,$4,4
sw $0, 0($4)
slt $3, $4, $5
bnez $3, $BSS_CLEAR
addiu $4, $4, 4
 
jal main2
nop
41,19 → 41,19
#address 0x3c
interrupt_service_routine:
#registers $26 and $27 are reserved for the OS
ori $26,$0,0xffff
ori $27,$0,46
sb $27,0($26) #echo out '.'
ori $26, $0, 0xffff
ori $27, $0, 46
sb $27, 0($26) #echo out '.'
#normally clear the interrupt source here
 
#return and re-enable interrupts
ori $26,$0,0x1
mfc0 $27,$14 #C0_EPC=14
jr $27
mtc0 $26,$12 #STATUS=1; 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
.end entry
 
 
###################################################
61,8 → 61,8
.ent isr_enable
isr_enable:
.set noreorder
jr $31
mtc0 $4,$12 #STATUS=1; enable interrupts
jr $31
mtc0 $4, $12 #STATUS=1; enable interrupts
.set reorder
.end isr_enable
 
72,15 → 72,15
.ent putchar
putchar:
.set noreorder
li $5,0xffff
li $5, 0xffff
 
#Uncomment to make each character on a seperate line
#The VHDL simulator buffers the lines
# sb $4,0($5)
# ori $4,$0,'\n'
# sb $4, 0($5)
# ori $4, $0, '\n'
 
jr $31
sb $4,0($5)
jr $31
sb $4, 0($5)
.set reorder
.end putchar
 
90,16 → 90,16
.ent puts
puts:
.set noreorder
ori $5,$0,0xffff
ori $5,$0,0xffff
PUTS1:
lb $6,0($4)
beqz $6,PUTS2
addiu $4,$4,1
b PUTS1
sb $6,0($5)
lb $6, 0($4)
beqz $6, PUTS2
addiu $4, $4, 1
b PUTS1
sb $6, 0($5)
PUTS2:
jr $31
ori $2,$0,0
jr $31
ori $2, $0, 0
.set reorder
.end puts
 

powered by: WebSVN 2.1.0

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