When calling the OSBYTE routine from machine code you will need to use the absolute address &40F4. However, when CALLing this routine from BBC BASIC it is recommended that you use the BBC Micro-compatible address &FFF4.
Introduction
The OSBYTE call provides a way to invoke routines provided by the host interface or operating system to carry out a wide variety of different tasks, such as setting the keyboard repeat rates or manipulating the Escape condition.
Before calling OSBYTE you must first set the Z80 accumulator register A to the number of the OSBYTE routine you wish to call. The Z80 registers L and H can also be used as inputs or outputs depending on the specified routine.
*FX provides a more convenient way to invoke OSBYTE routines from BASIC programs or the command-line.
Several routines return values in L or H. You may be able to retrieve these values from BBC BASIC if you call OSBYTE via USR as that returns the result from HLH'L'.
Unless otherwise mentioned, only the registers A, L and H will be modified. These are analogous to the A, X and Y 6502 CPU registers in the BBC Micro version of BBC BASIC.
Routines
OSBYTE &00, *FX 0
Identify Operating System version
If L is zero this will print a message identifying the version of the TI-83+ or TI-84+ OS. If L is non-zero this message is supressed.
After execution L will contain the value 29 (&1D) to identify the hardware as a TI-83+/TI-84+ calculator.
OSBYTE &01, *FX 1
Read/write the user flag
The user flag is replaced by
This flag is unused and left free for use in your own applications. It is reset to 0 on initialisation.
OSBYTE &04, *FX 4
Enable/disable cursor editing
L determines the the function of the cursor editing keys.
- *FX 4,0 - Enable cursor editing (default).
- *FX 4,1 - Disable cursor editing.
When disabled the cursor editing keys return the following values:
Key | Value |
---|---|
Copy | &87 (135) |
Left | &88 (136) |
Right | &89 (137) |
Down | &8A (138) |
Up | &8B (139) |
OSBYTE &0B, *FX 11
Set keyboard auto-repeat delay
L determines the delay before keys start repeating when held.
- *FX 11,0 - Disables key repeating.
- *FX 11,n - Sets the delay to n centiseconds.
The old setting is returned in L. The default delay value is 32 centiseconds.
OSBYTE &0C, *FX 12
Set keyboard auto-repeat rate
L determines the time period for repeating keys.
- *FX 12,0 - Resets repeat delay and repeat interval to their defaults.
- *FX 12,n - Sets the repeat interval to n centiseconds.
The old setting is returned in L. The default delay value is 8 centiseconds.
OSBYTE &7C, *FX 124
Clear Escape condition
This routine will instantly clear any pending Escape condition. If a previous call to OSRDCH had returned with the carry flag set to indicate the Escape condition you can use this routine to prevent BBC BASIC from receiving notification of the condition.
OSBYTE &7D, *FX 125
Clear Escape condition
This routine will set a pending Escape condition. Note that this is not affected by the ESC OFF command.
OSBYTE &7E, *FX 126
Acknowledge detection of an Escape condition
This routine attempts to clear the Escape condition after closing any open EXEC files.
On exit L is &FF if the condition was cleared successfully or &00 if the condition was not cleared.
OSBYTE &7F, *FX 127
Check for end-of-file on an opened file
L contains the file handle to check. On exit, L is non-zero if the end-of-file has been reached and zero if the end-of-file has not been reached.
See the EOF# keyword for more information.
OSBYTE &86, *FX 134
Read text cursor position (POS and VPOS)
On exit,
OSBYTE &87, *FX 135
Read character at text cursor position
On exit, L contains the character value.
OSBYTE &C4, *FX 196
Read/write keyboard auto-repeat delay
OSBYTE &C5, *FX 197
Read/write keyboard auto-repeat period (rate)
OSBYTE &C6, *FX 198
Read/write *EXEC file handle
The value is zero if no file is currently open.
OSBYTE &C8, *FX 200
Read/write Escape effect
If the least significant bit is
- 0, Escape functions as normal.
- 1, Escape is ignored unless it was caused by OSBYTE &7D.
OSBYTE &DA, *FX 218
Read/write number of items in the VDU queue
This contains the negative number of pending bytes required to execute the current VDU command. Writing 0 to this location is a useful way to abandon the queue - it is recommended that you do not write any other values.