Documentation of kernel API

This commit is contained in:
Kyle J Cardoza 2024-07-08 23:07:36 -04:00
parent 82ae21f95c
commit a4a72f6d16
1 changed files with 27 additions and 1 deletions

View File

@ -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.
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.