From 499a1e4e3e3e6c3b6bb0c5788bd1ba90b3aae377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20J=C2=A0Cardoza?= Date: Mon, 8 Jul 2024 23:54:43 -0400 Subject: [PATCH] Documentation of kernel API --- doc/syscalls.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/syscalls.md b/doc/syscalls.md index 079d79c..70415de 100644 --- a/doc/syscalls.md +++ b/doc/syscalls.md @@ -12,7 +12,7 @@ The system API is based loosely on, but not compatible with, that of CP/M-3 and MSX-DOS 2. Most calls return a status code in C. This code has one value, `STATUS_OK`, -(equal to `0x0000`) which applies to all such calls; this value indicates +(equal to `0x0000`) which applies to all sxuch calls; this value indicates that the call was successful. Any other value will indicate some specific error. @@ -243,7 +243,7 @@ string, which must contain a fully-qualified pathname -- something of the form `[drive]:/[dir]/[dir2]/filename.ext`, such as `sd0:/games/kaboom/readme.ansi`. If the file is successfully opened, the C accumulator will contain `STATUS_OK`, and -the X register will contain the file handle. On error, the C accumulator will contain +the `X` register will contain the file handle. On error, the C accumulator will contain a negative value indicating which error has occured. ## `0x0E`: Close File Handle @@ -271,7 +271,7 @@ Return Values: This call attempts to duplicate the provided file handle. The new file handle will be exactly identical to the provided one, and either may be used at any time. -On success, the C accumulator will contain a status code of `STATUS_OK`, and the X +On success, the C accumulator will contain a status code of `STATUS_OK`, and the `X` register will contain the duplicate file handle. On error, the C accumulator will contain a negative value, indicating an error has occured. @@ -298,8 +298,8 @@ Argument Structure: This call attempts to read up to `length` bytes from the file handle `file`, into 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 +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. ## `0x11`: Write to File @@ -325,8 +325,8 @@ Argument Structure: 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 +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. ## `0x12`: Seek in File @@ -346,8 +346,8 @@ Return value: This call moves the internal file pointer, the position in the specified file from which data can be read or to which data can be written. On success, this call returns - `STATUS_OK` in C, and the new file position in X and Y. On error, C will contain a negative -value indicating the specific error, and the new file position in X and Y. + `STATUS_OK` in `C`, and the new file position in `X` and `Y`. On error, `C` will contain a negative +value indicating the specific error, and the new file position in `X` and `Y`. ## `0x13`: Device I/O Control @@ -364,8 +364,8 @@ Return Values: - `C`: Status code This call attempts to delete the file indicated by the given `NULL`-terminated string, -which must contain a fully-qualified pathname. On success, this C will contain - `STATUS_OK`. On failure, C will contain a negative number indicating the specific +which must contain a fully-qualified pathname. On success, this `C` will contain + `STATUS_OK`. On failure, `C` will contain a negative number indicating the specific error. ## `0x15`: Move File @@ -388,5 +388,5 @@ Argument Structure: ``` This call attempts to move or rename the specified `source` file to `dest`. On success, -C will contain `STATUS_OK`. On error, C will contain a negative value indicating the + `C` will contain `STATUS_OK`. On error, `C` will contain a negative value indicating the specific error.