Skip to content

Latest commit

 

History

History
50 lines (50 loc) · 1.46 KB

File metadata and controls

50 lines (50 loc) · 1.46 KB

KM READ CHAR (Main Jumpblock)

Index: 3

Address: #BB09

Test if a character is available from the keyboard.

Action:

Try to get a character from the key buffer or the current expansion string. This routine does not wait for a character to become available if there is no character available immediately.

Entry conditions:

No conditions.

Exit conditions:

If there was a character available:
Carry true.
A contains the character.

If there was no character available:
Carry false.
A corrupt.

Always:
Other flags corrupt.
All other registers preserved.

Notes:

The possible sources for generating the next character are, in the order that they are tested:

  • The ‘put back’ character.

  • The next character of an expansion string.

  • The first character of an expansion string.

  • A character from a key translation table.

Expansion tokens in the key translation tables will be expanded to their associated strings. Expansion tokens found in expansion strings are not expanded but are treated as characters.

This routine will always return a character if one is available. It is therefore possible to flush out the Key Manager buffers by calling KM READ CHAR repeatedly until it reports that no character is available.

Related entries:

KM CHAR RETURN
KM FLUSH
KM READ KEY
KM WAIT CHAR