Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- mfc0 $a0 $12 # read from the status register
- ori $a0 0xff11 # enable all interrupts
- mtc0 $a0 $12 # write back to the status register
- li $a0 2 # enable keyboard interrupt
- sb $a0 0xffff0013
- li $t9 10000
- li $t0 0
- mtc1.d $t0 $f2
- cvt.d.w $f2 $f2
- li $t1 4
- mtc1.d $t1 $f4
- cvt.d.w $f4 $f4
- li $t2 2
- mtc1.d $t2 $f6
- cvt.d.w $f6 $f6
- li $t3 1
- mtc1.d $t3 $f8
- cvt.d.w $f8 $f8
- mtc1.d $t3 $f12
- cvt.d.w $f12 $f12
- mtc1.d $t3 $f10
- cvt.d.w $f10 $f10
- next: sub $t9 $t9 2
- mov.d $f8 $f12
- div.d $f8 $f8 $f10
- add.d $f2 $f2 $f8
- add.d $f10 $f10 $f6
- mov.d $f8 $f12
- div.d $f8 $f8 $f10
- sub.d $f2 $f2 $f8
- add.d $f10 $f10 $f6
- beqz $t9 end
- j next
- end:
- mul.d $f2 $f2 $f4
- mov.d $f12 $f2
- li $v0 3
- syscall
- .ktext 0x80000180 # kernel code starts here
- mfc0 $k0 $12 # !! disable interrupts
- andi $k0 $k0 0xfffe # !!
- mtc0 $k0 $12 # !!
- eret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement