SPIM Exception Handler Service

ServiceCode in $v0ArgumentsReturned Value
print integer1 $a0 == integer 
print float 2 $f12 == float  
print double 3 $f12 == double  
print string 4 $a0 == address of string 
read integer5  $v0 ← integer
read float 6  $f0 ← float
read double 7  $f0 ← double
read string 8 $a0 == buffer address
$a1 == buffer length
allocate memory 9 $a0 == number of bytes$v0 ← address
exit 10   

For double precision, the register given is the even numbered register of the even/odd register pair used for the 64 bit double. For example, the read double service 7 returns a 64 bit value in the pair $f0,$f1.

Warning: some of these services change T registers, so be careful about what registers a calling program uses! See:
Chapter 21 page 4

Click here