Documentation of kernel API
This commit is contained in:
parent
0049bf4830
commit
34de02afe4
116
doc/syscalls.md
116
doc/syscalls.md
|
@ -86,12 +86,12 @@ control.
|
||||||
## 0x05: String Output
|
## 0x05: String Output
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x05
|
- C: 0x05
|
||||||
X: Address of string (15:0)
|
- X: Address of string (15:0)
|
||||||
Y: Address of string (23:16)
|
- Y: Address of string (23:16)
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
None
|
- None
|
||||||
|
|
||||||
This call uses the 0x02 call "Console Output" above to send a NULL-terminated
|
This call uses the 0x02 call "Console Output" above to send a NULL-terminated
|
||||||
string to stdout.
|
string to stdout.
|
||||||
|
@ -99,12 +99,12 @@ string to stdout.
|
||||||
## 0x06: Buffered Line Input
|
## 0x06: Buffered Line Input
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x06
|
- C: 0x06
|
||||||
X: Address of buffer (15:0)
|
- X: Address of buffer (15:0)
|
||||||
Y: Address of buffer (23:16)
|
- Y: Address of buffer (23:16)
|
||||||
|
|
||||||
Return values:
|
Return values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
|
|
||||||
This call will read up to 255 characters from stdin, or up to the first newline,
|
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
|
whichever comes first. While taking input, a simple line editor is presented to
|
||||||
|
@ -117,10 +117,10 @@ string.
|
||||||
## 0x07: Console Status
|
## 0x07: Console Status
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x07
|
- C: 0x07
|
||||||
|
|
||||||
Return Values:
|
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
|
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.
|
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
|
## 0x08: Return Version Number
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x08
|
- C: 0x08
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Major version
|
- C: Major version
|
||||||
X: Minor version
|
- X: Minor version
|
||||||
Y: Micro version
|
- Y: Micro version
|
||||||
|
|
||||||
This call returns the version number of the kernel.
|
This call returns the version number of the kernel.
|
||||||
|
|
||||||
## 0x09: Get Date
|
## 0x09: Get Date
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x09
|
- C: 0x09
|
||||||
X: Bank of buffer
|
- X: Bank of buffer
|
||||||
Y: Address of buffer
|
- Y: Address of buffer
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
None
|
- None
|
||||||
|
|
||||||
This call fills in the specified buffer with the current date,
|
This call fills in the specified buffer with the current date,
|
||||||
in the following format:
|
in the following format:
|
||||||
|
@ -160,12 +160,12 @@ in the following format:
|
||||||
## 0x0A: Set Date
|
## 0x0A: Set Date
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0A
|
- C: 0x0A
|
||||||
X: Bank of buffer
|
- X: Bank of buffer
|
||||||
Y: Address of buffer
|
- Y: Address of buffer
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
@ -181,12 +181,12 @@ This call sets the system date from the data in the argument structure.
|
||||||
## 0x0B: Get Time
|
## 0x0B: Get Time
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0B
|
- C: 0x0B
|
||||||
X: Bank of buffer
|
- X: Bank of buffer
|
||||||
Y: Address of buffer
|
- Y: Address of buffer
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
@ -201,12 +201,12 @@ This call fills in the specified argument structure with the current time.
|
||||||
## 0x0C: Set Time
|
## 0x0C: Set Time
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0C
|
- C: 0x0C
|
||||||
X: Bank of argument structure
|
- X: Bank of argument structure
|
||||||
Y: Address of buffer
|
- Y: Address of buffer
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
|
|
||||||
Argument Structure:
|
Argument Structure:
|
||||||
|
|
||||||
|
@ -221,13 +221,13 @@ This call sets the current time from the provided argument structure.
|
||||||
## 0x0D: Open File
|
## 0x0D: Open File
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0D
|
- C: 0x0D
|
||||||
X: Bank of pathname string
|
- X: Bank of pathname string
|
||||||
Y: Address of pathname string
|
- Y: Address of pathname string
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
X: File handle
|
- X: File handle
|
||||||
|
|
||||||
This call attempts to open the file referred to by the provided NULL-terminated
|
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
|
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
|
## 0x0E: Close File Handle
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0E
|
- C: 0x0E
|
||||||
X: File handle
|
- X: File handle
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
|
|
||||||
This call attempts to close the file referred to by the provided file handle.
|
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,
|
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
|
## 0x0F: Duplicate File Handle
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x0F
|
- C: 0x0F
|
||||||
X: File handle
|
- X: File handle
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
X: Duplicate of file handle
|
- X: Duplicate of file handle
|
||||||
|
|
||||||
This call attempts to duplicate the provided file handle. The new 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.
|
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
|
## 0x10: Read from File
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x10
|
- C: 0x10
|
||||||
X: Bank of argument block
|
- X: Bank of argument block
|
||||||
Y: Address of argument block
|
- Y: Address of argument block
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
X: Number of bytes actually read
|
- X: Number of bytes actually read
|
||||||
|
|
||||||
Argument block structure:
|
Argument block structure:
|
||||||
|
|
||||||
|
@ -295,13 +295,13 @@ register will contain the number of bytes actually read.
|
||||||
## 0x11: Write to File
|
## 0x11: Write to File
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x11
|
- C: 0x11
|
||||||
X: Bank of argument block
|
- X: Bank of argument block
|
||||||
Y: Address of argument block
|
- Y: Address of argument block
|
||||||
|
|
||||||
Return Values:
|
Return Values:
|
||||||
C: Status code
|
- C: Status code
|
||||||
X: Number of bytes actually written
|
- X: Number of bytes actually written
|
||||||
|
|
||||||
Argument block structure:
|
Argument block structure:
|
||||||
|
|
||||||
|
@ -321,12 +321,12 @@ register will contain the number of bytes actually written.
|
||||||
## 0x12: Seek in File
|
## 0x12: Seek in File
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
C: 0x12
|
- C: 0x12
|
||||||
X: Seek value
|
- X: Seek value
|
||||||
Y: Seek origin
|
- Y: Seek origin
|
||||||
0x00: Seek relative to the beginning of the file
|
- 0x00: Seek relative to the beginning of the file
|
||||||
0x01: Seek relative to the current position in the file
|
- 0x01: Seek relative to the current position in the file
|
||||||
0x02: Seek relative to the end of the file
|
- 0x02: Seek relative to the end of the file
|
||||||
|
|
||||||
Return value:
|
Return value:
|
||||||
C: Status code
|
C: Status code
|
||||||
|
|
Loading…
Reference in New Issue