OS_Byte 128
===========
(SWI &06)
=========

Gets mouse coordinates, or number of bytes in an input buffer, or number of 
free bytes in an output buffer

On entry
--------
R0 = 128
R1 = reason code

On exit
-------
R0 preserved
R1 = low 8 bits of answer
R2 = high 24 bits of answer

Interrupts
----------
Interrupt status is undefined
Fast interrupts are enabled

Processor mode
--------------
Processor is in SVC mode

Re-entrancy
-----------
Not defined

Use
---
The action of this call depends upon the reason code in R1. It returns either 
the current x or y position of the mouse, or the number of bytes in a particular 
input buffer, or how many bytes there are free in a particular output buffer:

   On entry      On exit R1 & R2 contain the:

   R1 = 7        mouse x position
   R1 = 8        mouse y position
   R1 = 246      number of bytes in the mouse buffer
   R1 = 252      number of bytes free in the printer buffer
   R1 = 253      number of bytes free in the RS423 output buffer
   R1 = 254      number of bytes in the RS423 input buffer
   R1 = 255      number of bytes in the keyboard buffer

Obviously we are more concerned with the calls where R1 >= 246 here. Note 
that R1 = (255 - buffer number) in these cases. If you want, you can also 
calculate this as { - (buffer number + 1) AND &FF }.

Related SWIs
------------
None

Related vectors
---------------
ByteV

********************************************************************************
OS_Byte 145
===========
(SWI &06)
=========

Gets a byte from a buffer

On entry
--------
R0 = 145
R1 = buffer number

On exit
-------
R0, R1 preserved
R2 = byte extracted
C flag = 1 if buffer was empty

Interrupts
----------
Interrupt status is undefined
Fast interrupts are enabled

Processor mode
--------------
Processor is in SVC mode

Re-entrancy
-----------
Not defined

Use
---
This call extracts the next byte from a specified buffer. If the buffer was 
empty then the C flag is set, and R2 will be invalid.

Related SWIs
------------
None

Related vectors
---------------
ByteV, RemV

********************************************************************************
OS_Byte 153
===========
(SWI &06)
=========

Inserts a byte into one of the two input buffers

On entry
--------
R0 = 153
R1 = buffer number (0 or 1)
R2 = byte to insert

On exit
-------
R0 preserved
R1, R2 corrupted
C flag = 1 if buffer was full

Interrupts
----------
Interrupt status is undefined
Fast interrupts are enabled

Processor mode
--------------
Processor is in SVC mode

Re-entrancy
-----------
Not defined

Use
---
This call enables bytes to be inserted into one of the two input buffers as 
follows:

   R1 = 0        insert byte into the keyboard buffer
   R1 = 1        insert byte into the RS423 input buffer

If the buffer was full and a byte could not be inserted, then the C flag is set 
on return.

If the current escape character (usually ASCII 27) is inserted, then 
appropriate action is taken; see the chapter entitled Character input.

Related SWIs
------------
OS_Byte 138 (SWI &06)

Related vectors
---------------
ByteV, InsV
