面向零基础的编程辅导教程

写程序,学编程,一对一辅导,代码调试Debug 微信:ittutor QQ:14061936

MIPS 异常处理

mips异常(exception)处理程序: 

.text
la $t0, 0x7ffffff
add $t0, $t0, $t0

li $v0, 10
syscall


  .ktext 0x80000180
   move $k0,$v0   # Save $v0 value
   move $k1,$a0   # Save $a0 value
   la   $a0, msg  # address of string to print
   li   $v0, 4    # Print String service
   syscall
   move $v0,$k0   # Restore $v0
   move $a0,$k1   # Restore $a0
   mfc0 $k0,$14   # Coprocessor 0 register $14 has address of trapping instruction
   addi $k0,$k0,4 # Add 4 to point to next instruction
   mtc0 $k0,$14   # Store new address back into $14
   eret           # Error return; set PC to value in $14
   .kdata	
msg:   
   .asciiz "Trap generated"

 

C C++ Python Java MIPS Processing 程序编写 软件定制 远程教学 网络家教

写程序,学编程,一对一辅导,代码调试Debug 微信:ittutor QQ:14061936

Copyright 小艾米编程 鲁ICP备18032308号-1