Documentation of kernel API

This commit is contained in:
Kyle J Cardoza 2024-07-08 23:33:09 -04:00
parent 0049bf4830
commit 34de02afe4
1 changed files with 58 additions and 58 deletions

View File

@ -86,12 +86,12 @@ control.
## 0x05: String Output
Arguments:
C: 0x05
X: Address of string (15:0)
Y: Address of string (23:16)
- C: 0x05
- X: Address of string (15:0)
- Y: Address of string (23:16)
Return Values:
None
- None
This call uses the 0x02 call "Console Output" above to send a NULL-terminated
string to stdout.
@ -99,12 +99,12 @@ string to stdout.
## 0x06: Buffered Line Input
Arguments:
C: 0x06
X: Address of buffer (15:0)
Y: Address of buffer (23:16)
- C: 0x06
- X: Address of buffer (15:0)
- Y: Address of buffer (23:16)
Return values:
C: Status code
- C: Status code
This call will read up to 255 characters from stdin, or up to the first newline,
whichever comes first. While taking input, a simple line editor is presented to
@ -117,10 +117,10 @@ string.
## 0x07: Console Status
Arguments:
C: 0x07
- C: 0x07
Return Values:
C: Status Code
- C: Status Code
This call checks stdin for a character to read. If there is none, this call will return
zero in C; if there is a character ready, it will return nonzero in C.
@ -128,24 +128,24 @@ zero in C; if there is a character ready, it will return nonzero in C.
## 0x08: Return Version Number
Arguments:
C: 0x08
- C: 0x08
Return Values:
C: Major version
X: Minor version
Y: Micro version
- C: Major version
- X: Minor version
- Y: Micro version
This call returns the version number of the kernel.
## 0x09: Get Date
Arguments:
C: 0x09
X: Bank of buffer
Y: Address of buffer
- C: 0x09
- X: Bank of buffer
- Y: Address of buffer
Return Values:
None
- None
This call fills in the specified buffer with the current date,
in the following format:
@ -160,12 +160,12 @@ in the following format:
## 0x0A: Set Date
Arguments:
C: 0x0A
X: Bank of buffer
Y: Address of buffer
- C: 0x0A
- X: Bank of buffer
- Y: Address of buffer
Return Values:
C: Status code
- C: Status code
Argument Structure:
@ -181,12 +181,12 @@ This call sets the system date from the data in the argument structure.
## 0x0B: Get Time
Arguments:
C: 0x0B
X: Bank of buffer
Y: Address of buffer
- C: 0x0B
- X: Bank of buffer
- Y: Address of buffer
Return Values:
C: Status code
- C: Status code
Argument Structure:
@ -201,12 +201,12 @@ This call fills in the specified argument structure with the current time.
## 0x0C: Set Time
Arguments:
C: 0x0C
X: Bank of argument structure
Y: Address of buffer
- C: 0x0C
- X: Bank of argument structure
- Y: Address of buffer
Return Values:
C: Status code
- C: Status code
Argument Structure:
@ -221,13 +221,13 @@ This call sets the current time from the provided argument structure.
## 0x0D: Open File
Arguments:
C: 0x0D
X: Bank of pathname string
Y: Address of pathname string
- C: 0x0D
- X: Bank of pathname string
- Y: Address of pathname string
Return Values:
C: Status code
X: File handle
- C: Status code
- X: File handle
This call attempts to open the file referred to by the provided NULL-terminated
string, which must contain a fully-qualified pathname -- something of the form
@ -240,11 +240,11 @@ a negative value indicating which error has occured.
## 0x0E: Close File Handle
Arguments:
C: 0x0E
X: File handle
- C: 0x0E
- X: File handle
Return Values:
C: Status code
- C: Status code
This call attempts to close the file referred to by the provided file handle.
On success, the C accumulator will contain a status code of STATUS_OK. On error,
@ -253,12 +253,12 @@ the C accumulator will contain a negative value, indicating an error has occured
## 0x0F: Duplicate File Handle
Arguments:
C: 0x0F
X: File handle
- C: 0x0F
- X: File handle
Return Values:
C: Status code
X: Duplicate of file handle
- C: Status code
- X: Duplicate of file handle
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.
@ -269,13 +269,13 @@ contain a negative value, indicating an error has occured.
## 0x10: Read from File
Arguments:
C: 0x10
X: Bank of argument block
Y: Address of argument block
- C: 0x10
- X: Bank of argument block
- Y: Address of argument block
Return Values:
C: Status code
X: Number of bytes actually read
- C: Status code
- X: Number of bytes actually read
Argument block structure:
@ -295,13 +295,13 @@ register will contain the number of bytes actually read.
## 0x11: Write to File
Arguments:
C: 0x11
X: Bank of argument block
Y: Address of argument block
- C: 0x11
- X: Bank of argument block
- Y: Address of argument block
Return Values:
C: Status code
X: Number of bytes actually written
- C: Status code
- X: Number of bytes actually written
Argument block structure:
@ -321,12 +321,12 @@ register will contain the number of bytes actually written.
## 0x12: Seek in File
Arguments:
C: 0x12
X: Seek value
Y: Seek origin
0x00: Seek relative to the beginning of the file
0x01: Seek relative to the current position in the file
0x02: Seek relative to the end of the file
- C: 0x12
- X: Seek value
- Y: Seek origin
- 0x00: Seek relative to the beginning of the file
- 0x01: Seek relative to the current position in the file
- 0x02: Seek relative to the end of the file
Return value:
C: Status code