From a4a72f6d1627c37ea6e580ac1cb6ec2d11b52b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20J=C2=A0Cardoza?= Date: Mon, 8 Jul 2024 23:07:36 -0400 Subject: [PATCH] Documentation of kernel API --- doc/syscalls.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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