OSBYTE &A2

From BeebWiki
Revision as of 19:12, 8 March 2015 by WikiSysop (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Enable/Disable GXR

 On entry:
   X=0   Disable GXR (version 1.xx), Enable GXR (version 2.xx)
   X=128 Enable GXR (version 1.xx), Disable GXR (version 2.xx)

The Graphics Extension ROM for the BBC B and BBC B+ can be enabled and disabled with OSBYTE &A2. See also Talk:OSBYTE &A2.

Write configuration RAM/EEPROM

 On entry:
   X=index of byte to write
   Y=byte to write
 On exit:
   undefined

OSBYTE &A2 reads a byte to the configuration RAM/EEPROM. There are typically 50 locations but implementations can have more. The Master 128 uses 50 bytes of nonvolatile CMOS RAM, the Master Compact uses a 128-byte or a 256-byte EEPROM, the Master Extension ROM for the BBC B uses a block of memory or a file on disk.

Location zero holds the local station number and is protected from being written with OSBYTE &A2. It can only be changed with a utility such as *SetStation.

Some implementations of configuration RAM have a limited write-cycle time, so it is best to only write a value if it is not already the same. The following code will write a block of configuration data:

 REM max%=number of locations -1
 REM mem%=block of configuration data
 FOR X%=1 TO max%
 A%=161:Y%=((USR&FFF4)AND&FF0000)DIV256
 IF mem%?X%<>Y% THEN Y%=mem%?X%:A%=162:CALL &FFF4
 NEXT X%

See Also

Jgharston 16:06, 31 October 2010 (UTC)