repositories
/
TD_IML.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Add error handling sample code
[TD_IML.git]
/
error_handling
/
mips1.asm
1
.ktext 0x80000180
2
li $k1, 16
3
mfc0 $k0, $13
4
beq $k0, $k1, errmem
5
move $k0, $a0
6
move $k1, $v0
7
la $a0, trapmsg
8
li $v0, 4
9
syscall
10
j kret
11
errmem:
12
move $k0, $a0
13
move $k1, $v0
14
la $a0, memmsg
15
li $v0, 4
16
syscall
17
kret:
18
move $a0, $k0
19
move $k1, $v0
20
mfc0 $k0, $14
21
addi $k0, $k0, 4
22
mtc0 $k0, $14
23
eret
24
.kdata
25
trapmsg: .asciiz "T"
26
memmsg: .asciiz "O"
27
.text
28
teq $0, $0
29
lb $t1, 0($0)