diff --git a/doc/syscalls.md b/doc/syscalls.md index 7658459..4088f22 100644 --- a/doc/syscalls.md +++ b/doc/syscalls.md @@ -285,4 +285,30 @@ This call attempts to read up to `length` bytes from the file handle `file`, int the buffer pointed to by `dest`. On success, the C accumulator will contain STATUS_OK, and the X register will contain the number of bytes actually read. On error, the C accumulator will contain a negative value indicating the specific error, and the X -register will contain the number of bytes actually read. \ No newline at end of file +register will contain the number of bytes actually read. + +## 0x11: Write to File Handle + +Arguments: + C: 0x11 + X: Bank of argument block + Y: Address of argument block + +Return Values: + C: Status code + X: Number of bytes actually written + +Argument block structure: + + struct { + void *src; // Pointer to the buffer to use. + uint16_t file; // File handle. + size_t length; // Maximum number of bytes to write. + }; + + +This call attempts to write up to `length` bytes to the file handle `file`, from +the buffer pointed to by `src`. On success, the C accumulator will contain STATUS_OK, +and the X register will contain the number of bytes actually written. On error, the C +accumulator will contain a negative value indicating the specific error, and the X +register will contain the number of bytes actually written. \ No newline at end of file