Difference between revisions of "OSBYTE &AC"

From BeebWiki
Jump to: navigation, search
m (1 revision)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:OSBYTE]]
+
[[Category:OSBYTE]]__NOTOC__
OSBYTE &AC (172) - Read address of keyboard table
+
{{PageTitle|OSBYTE &AC (172) - Read/Write keyboard driver variables}}
 +
''On entry:'' '''newvalue''' = ('''oldvalue''' AND Y) EOR X
  
    On exit X and Y point to a table mapping from internal to ASCII key numbers
+
'' On exit:'' YX=address of keyboard transation table. The top bits indicate if the
    The shape and layout of the table is of course hardware specific, so this
+
MOS keyboard driver is being used or an alternative keyboard driver is being used.
    call should be used with caution
+
 
 +
* If Y=%11xxxxxx, MOS keyboard driver
 +
* If Y=%10xxxxxx, sideways ROM keyboard driver
 +
* If Y=%0xxxxxxx, International keyboard driver.
 +
 
 +
===MOS keyboard driver===
 +
With the MOS keyboard driver, the address is the base of the internal keyboard
 +
table. The offsets into the table are the [[Keyboard|internal scan codes]], being
 +
the negative INKEY number EOR 255, so 'Q' is key number &10, etc.
 +
 
 +
An entry of &00 is translated to the current TAB character set with
 +
[[OSBYTE &DB|OSBYTE 219]]. The entries for CAPSLOCK and SHIFTLOCK hold &01 and &02,
 +
but these are never used as the MOS checks for these two keys explicitly.
 +
 
 +
The MOS never uses the values returned by OSBYTE &AC and &AD, so changing
 +
them does not change the action of the MOS keyboard driver.
 +
 
 +
===Communicator===
 +
The Communicator uses this location to select between .= and *# keys on
 +
the numeric keypad.
 +
 
 +
===Sideways ROM keyboard driver===
 +
A keyboard driver in sideways ROM can use these two locations for its own use
 +
by setting OSBYTE &AD to %10xxxxxx. These locations then hold:
 +
* OSBYTE &AC the current keypress
 +
* OSBYTE &AD the keyboard number in b5-b0
 +
 
 +
===International keyboard driver===
 +
With MOS 3.50 and MOS 5, if Y bit 7 is clear (implying a keyboard table in low
 +
memory), the MOS keyboard handler issues Service Call &30 to translate keypresses.
 +
With an International Keyboard Driver present:
 +
* OSBYTE &AC holds the translated keypress on return from Service Call &30
 +
* OSBYTE &AD holds the keyboard number in b4-b0, and returns the 'NULL needed' flag in b6.
  
 
==See Also==
 
==See Also==
 +
* [[OSBYTE &46]] - Set country (both keyboard and alphabet)
 +
* [[OSBYTE &47]] - Set keyboard and alphabet
 +
* [[OSBYTE &AC]] - Read/write keyboard handler setting
 +
* [[OSBYTE &AD]] - Read/write keyboard handler setting
 +
* [[OSBYTE &F0]] - Read/write country code
 +
* http://mdfs.net/Docs/Comp/BBC/Osbyte00
 
* http://mdfs.net/Docs/Comp/BBC/OsbyteA6
 
* http://mdfs.net/Docs/Comp/BBC/OsbyteA6
 +
* http://mdfs.net/System/ROMs/AcornMOS/Compact511
  
 
[[User:Jgharston|Jgharston]] 22:23, 26 May 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 22:23, 26 May 2009 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 21:50, 13 September 2019 (CEST)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 06:40, 12 April 2020 (CEST)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 23:22, 18 October 2020 (CEST)

Latest revision as of 20:49, 29 December 2020

OSBYTE &AC (172) - Read/Write keyboard driver variables

On entry: newvalue = (oldvalue AND Y) EOR X

On exit: YX=address of keyboard transation table. The top bits indicate if the MOS keyboard driver is being used or an alternative keyboard driver is being used.

  • If Y=%11xxxxxx, MOS keyboard driver
  • If Y=%10xxxxxx, sideways ROM keyboard driver
  • If Y=%0xxxxxxx, International keyboard driver.

MOS keyboard driver

With the MOS keyboard driver, the address is the base of the internal keyboard table. The offsets into the table are the internal scan codes, being the negative INKEY number EOR 255, so 'Q' is key number &10, etc.

An entry of &00 is translated to the current TAB character set with OSBYTE 219. The entries for CAPSLOCK and SHIFTLOCK hold &01 and &02, but these are never used as the MOS checks for these two keys explicitly.

The MOS never uses the values returned by OSBYTE &AC and &AD, so changing them does not change the action of the MOS keyboard driver.

Communicator

The Communicator uses this location to select between .= and *# keys on the numeric keypad.

Sideways ROM keyboard driver

A keyboard driver in sideways ROM can use these two locations for its own use by setting OSBYTE &AD to %10xxxxxx. These locations then hold:

  • OSBYTE &AC the current keypress
  • OSBYTE &AD the keyboard number in b5-b0

International keyboard driver

With MOS 3.50 and MOS 5, if Y bit 7 is clear (implying a keyboard table in low memory), the MOS keyboard handler issues Service Call &30 to translate keypresses. With an International Keyboard Driver present:

  • OSBYTE &AC holds the translated keypress on return from Service Call &30
  • OSBYTE &AD holds the keyboard number in b4-b0, and returns the 'NULL needed' flag in b6.

See Also

Jgharston 22:23, 26 May 2009 (UTC) Jgharston (talk) 21:50, 13 September 2019 (CEST) Jgharston (talk) 06:40, 12 April 2020 (CEST) Jgharston (talk) 23:22, 18 October 2020 (CEST)