Steven Herbst, 4.23.05 FILE I/O with SPIM: The 'open' system call has the code '13', and requires the following arguments: $a0: filename (string) $a1: flags - bitwise-or O_RDONLY, O_WRONLY, or O_RDWR with any of the other 'O_' constants Type 'man 2 open' for details on the meaning of each constant $a2: mode - when O_CREAT is specified, $a2 must be set to one of the 'S_' constants Type 'man 2 open' for details on the meaning of each constant Returns file descriptor in $v0 The 'read' system call has the code '14', and requires the following arguments: $a0: file descriptor (integer from 'open' system call) $a1: buffer - storage location of characters being read $a2: length - number of characters to read Returns the number of characters read in $v0 The 'write' system call has the code '15', and requires the following arguments: $a0: file descriptor (integer from 'open' system call) $a1: buffer - location of characters being written $a2: length - number of characters to write Returns the number of characters written in $v0 The 'close' system call has the code '16', and requires the following argument: $v0: file descriptor (integer from 'close' system call) CONSTANTS: O_RDONLY: 0 O_WRONLY: 1 O_RDWR: 2 O_CREAT: 64 O_EXCL: 128 O_NOCTTY: 256 O_TRUNC: 512 O_APPEND: 1024 O_NONBLOCK: 2048 O_NDELAY: 2048 O_SYNC: 4096 S_IRWXU: 448 S_IRUSR: 256 S_IREAD: 256 S_IWUSR: 128 S_IWRITE: 128 S_IXUSR: 64 S_IEXEC: 64 S_IRWXG: 56 S_IRGRP: 32 S_IWGRP: 16 S_IXGRP: 8 S_IRWXO: 7 S_IROTH: 4 S_IWOTH: 2 S_IXOTH: 1