OSBYTE &80

From BeebWiki
Revision as of 12:14, 27 May 2009 by Jgharston (talk) (moved OSBYTE 80 to OSBYTE &80)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


OSBYTE &80 (128) - Read I/O device or buffer status

On entry, If XY<0, read buffer status
          If XY>=0, read I/O device

On exit XY=returned value
XY on entry XY on exit
0 b0-b7=buttons, b8-b15=last ADC channel converted
1 Analogue Channel 1
2 Analogue Channel 2
3 Analogue Channel 3
4 Analogue Channel 4
5 Mouse X boundary
6 Mouse Y boundary
7 Mouse X position
8 Mouse Y position
9
&FFFF (-1) Keyboard buffer
&FFFE (-2) Serial input buffer
&FFFD (-3) Serial output buffer
&FFFC (-4) Printer output buffer
&FFFB (-5) Sound output buffer 0
&FFFA (-6) Sound output buffer 1
&FFF9 (-7) Sound output buffer 2
&FFF8 (-8) Sound output buffer 3
&FFF7 (-9) Speech output buffer
&FFF6 (-10) Mouse input buffer
&FFF5 (-11) MIDI input buffer {check}
&FFF4 (-12) MIDI output buffer {check}

Calling from BBC BASIC

=ADVAL() calls OSBYTE &80

Implementations

If an unknown device or buffer is examined, then the call is passed to sideways ROMs as an Unknown OSBYTE service call. {check: some exceptions}

Mouse

Most mouse drivers do not implement calls 5, 6 and 9. The VFS Videodisk Filing System ROM used with the Domesday System implements 5, 6 and 9. The mouse buttons are more usually read with INKEY-10, INKEY-11 and INKEY-12. 8-bit systems rarely implement a mouse buffer. 32-bit systems usually use a sound system that does not use the sound output buffers.

Jgharston 18:59, 11 September 2007 (BST)