Hex Availability and use ------------------------------------------------------------------------------ &80 (Acorn MOS 0.10) Read ADC Channel/Buffer status. Called by BASIC's =ADVAL function. Y=0 X=0 returns X=b0 fire button status b1 fire button Y=last ADC channel number read X=1..4 returns X=low byte of ADC channel X Y=high byte of ADC channel X X=5 mouse X boundary X=6 mouse Y boundary X=7 mouse X position X=8 mouse Y position X=9 mouse buttons Y=255 X=255 Keyboard buffer level X=254 Serial input buffer level X=253 Serial output buffer level X=252 Printer buffer level X=251 Sound channel 0 buffer level X=250 Sound channel 1 buffer level X=249 Sound channel 2 buffer level X=248 Sound channel 3 buffer level X=247 Speech buffer level X=246 Mouse buffer level &81 (Acorn MOS 0.10) Read Key with Time Limit or Machine Type. Called by BASIC's =INKEY function. Action: Read key with time limit X=0..255 Y=0..127 On exit C=0 character read, Y=0, X=character read C=1, Y=255 timed out C=1, Y=27 ESCAPE was pressed Action: Read OS version X=0 Y=255 On exit X=value identifying OS X=&00 BBC B with MOS 0.10 X=&00 RM Nimbus X=&01 Acorn Electron MOS X=&FF BBC Micro OS 1.00/1.20 X=&FE BBC Micro (American MOS 1.10) X=&FE NetBSD X=&FD Master 128 MOS 3.20 X=&FC BBC Micro (West German MOS) X=&FC Windows 32 X=&FB BBC B+ 64/128 (MOS2.00) X=&FB Beos (Brandy Basic) X=&FA Acorn ABC X=&FA DOS with Brandy BASIC X=&F9 Linux X=&F8 MacOS X (Brandy Basic) X=&F7 Master ET OS 4.00 X=&F7 FreeBSD X=&F6 OpenBSD X=&F5 Compact X=&F5 Amiga (Brandy Basic) X=&F4 Master 128 MOS 3.26 X=&Ex Spectrum &E0 ZX Spectrum X=&Dx Amstrad 464/664/6128, etc. X=&Ax Arthur/RISC OS X=&A0 Arthur 1.xx X=&A1 RISC OS 2.00 X=&A2 RISC OS 2.01 X=&A3 RISC OS 3.0x X=&A4 RISC OS 3.1x X=&A5 RISC OS 3.50 X=&A6 RISC OS 3.60 X=&A7 RISC OS 3.7x X=&A8 RISC OS 4.0x X=&A9 RISC OS 4.3x X=&AA RISC OS 5.xx X=&AF Springboard (An ARM-based development system plugged into a PC) X=&8x Texas Instruments Calculator &83 TI-83+(SE) &84 TI-84+(SE) X=&57 BBC BASIC for Windows Action: Scan for a range of keys X=1..127 lowest internal key number to start at EOR&7F Y=255 On exit X=internal key number pressed (or 255 for none) Action: Scan for a particular key X=128..255 internal key number to scan for EOR &80 Y=255 On exit X=Y=0 for as not pressed X=Y=255 the key was being pressed &82 (Acorn MOS 0.10) Read High Order Address Returns X=lo byte of 32 bit address of this machine Y=hi byte of 32 bit address of this machine ie. this machine's 32 bit address is &YYXX0000 upwards &83 (Acorn MOS 0.10) Read OSHWM, bottom of user memory On exit X and Y hold the lowest address of user memory, used to initialise BASIC's 'PAGE'. If b7 of A is clear, then A:Y:X holds the 23-bit address of the bottom of user memory, as when running 6502Turbo code on a CoProcessor, which returns A=&01, XY=&0000. &84 (Acorn MOS 0.10) Read top of user memory On exit X and Y point to the first byte after the top of user memory, used to initialise BASIC's 'HIMEM'. If b7 of A is clear, then A:Y:X holds the 23-bit address of the top of user memory, as when running 6502Turbo code on a CoProcessor, which returns A=&04, XY=&0000. &85 (Acorn MOS 0.10) Read base of display RAM for a given mode X=mode number On exit X and Y point to the first byte of screen RAM if MODE X were chosen &86 (Acorn MOS 0.10) Text cursor position. Called by BASIC's =POS and =VPOS functions. Returns X and Y of the current cursor position (or input cursor if in editing mode due to cursor keys) &87 (Acorn MOS 0.10) Character at text cursor and screen MODE. Called by BASIC's =MODE function. On exit X=character at current cursor position (or 0 if unreadable) Y=current mode number (shadow modes DO NOT return with bit 7 set) &88 (Acorn MOS 1.00) Called by *CODE The call performs a JSR to the current location of USERV, with X and Y set to whatever the OSByte was called with &89 (Acorn MOS 0.10) Cassette Motor Control, called by *MOTOR X=0 relay turned off X=1 relay turned off The default tape filing system enters with Y=0 for write operations and Y=1 for read operations. Hence, a machine could be adapted to have seperate read and write drives. &8A (Acorn MOS 1.00) Place character into buffer X=buffer number Y=character to place &8B (Acorn MOS 0.10) Set filing system attributes (called by *OPT) This call is a direct equivalent to *OPT x,y &8C (Acorn MOS 0.10) Select Tape FS at 1200/300 baud (called by *TAPE) X=0 perform *TAPE and select default speed (1200) X=3 perform *TAPE at 300 baud X=12 perform *TAPE at 1200 baud &8D (Acorn MOS 1.00) Select RFS (called by *ROM) &8E (Acorn MOS 1.00) Enter Language ROM X=socket number that the language ROM is in If the Tube is active the ROM will be copied across to the coprocessor The call does not return as the language resets the stack (Acorn MOS 3.20) If the ROM has been unplugged this will have no effect, or if the ROM is not a language ROM the error 'This is not a language' will be raised (Acorn MOS 3.50) If b6=1 then any language with a relocation table will not be relocated when copied across the Tube &8F (Acorn MOS 1.00) Issue SWR Service Request (on exit Y=response to request if appropriate) X=request number Y=parameter to pass (varies depending on the request number) &90 (Acorn MOS 0.10) Set TV offset and interlacing (called by *TV x,y) X=vertical screen shift Y=0/1 to turn off/on interlacing On exit X and Y contain the old value.The settings will be effected on the next MODE change &91 (Acorn MOS 1.00) Read character from buffer X=buffer number On exit Y=character got, or C=1 if the buffer was empty (RISC OS 1.00) If the chosen buffer is X=9 (mouse) then interrupts should be disabled while inserting bytes into the buffer incase the real mouse starts to put bytes in between yours. Top bit set characters should be entered into the keyboard buffer preceded by a byte 0 to prevent them from being mistaken for F-key presses or ALT and CTRL key shortcuts. &92 (Acorn MOS 1.00) Read FRED X=offset within page &FC. On exit Y=byte read &93 (Acorn MOS 1.00) Write FRED X=offset within page &FC and Y=byte to write &94 (Acorn MOS 1.00) Read JIM X=offset within page &FD. On exit Y=byte read &95 (Acorn MOS 1.00) Write JIM X=offset within page &FD and Y=byte to write &96 (Acorn MOS 1.00) Read SHELIA X=offset within page &FE. On exit Y=byte read &97 (Acorn MOS 1.00) Write SHELIA X=offset within page &FE and Y=byte to write &98 (Acorn MOS 1.20) Examine Buffer Status X=buffer number On exit C=0 Y=offset from address held at &FA to the next byte to get C=1 buffer empty (Acorn MOS 2.00) The Y register actually contains the next value,not just an offset as with the earlier OS. Note Interrupts should be disabled during this call to ensure the interrupt routine doesn't alter the buffer while you're reading it This OSByte doesn't actually remove the byte No range checking is performed on the buffer number and non existant buffer numbers have undefined results &99 (Acorn MOS 1.20) Write character into input buffer checking for ESCAPE X=buffer number Y=byte to insert On exit C=1=buffer was full If Y is the ESCAPE character, then no keyboard event will happen as an ESCAPE condition (hence ESCAPE event) are in progress. &9A (Acorn MOS 1.20) Write to Video ULA control register and RAM copy This call places X into register 0 of the 6845, and updates the RAM copy (Electron OS only) Reset flashing colours This call forces the ULA to set any flashing colours back to the first of the two (the 'mark' colour) &9B (Acorn MOS 1.20) Write to Video ULA palette register and RAM copy This call places X into register 1 of the 6845, and updates the RAM copy (Electron OS only) Completely ignored, performing an RTS immediately &9C (Acorn MOS 1.20) Read/write 6850 ACIA registers. If an 6850 ACIA is not used, the serial drivers translate the parameters appropriately. Y=255 to read X=b0..1 0=use basic baud rate 1=use chosen baud rate/16 2=use chosen baud rate/64 3=reset transmit,receive,control registers b2..4 0=7 bit, even parity, 2 stop bits (7E2) 1=7 bit, odd parity, 2 stop bits (7O2) 2=7 bit, even parity, 1 stop bits (7E1) 3=7 bit, odd parity, 1 stop bit (7O1) 4=8 bit, no parity, 2 stop bits (8N2) 5=8 bit, no parity, 1 stop bits (8N1) 6=8 bit, even parity, 1 stop bits (8E1) 7=8 bit, odd parity, 1 stop bit (8O1) b5..6 0=RTS low, transmit interrupt disabled 1=RTS low, transmit interrupt enabled 2=RTS high, transmit interrupt disabled 3=RTS low, transmit interrupt disabled, break level on transmit data b7 0=receive interrupt disabled 1=receive interrupt enabled Y=0 to write X=as above (RISC OS 1.00) X=b0..1 0=no effect 1=no effect 2=no effect (Electron OS only) Passed as an unknown osbyte to the paged ROMs For compatability with non-6850 systems, programs should use: Y=0, X=3 to reset the ACIA Y=159, X=0 to stop transmitting a serial break Y=159, X=96 to start transmitting a serial break Y=227, X=n*4 to set word format &9D (Acorn MOS 1.20) Fast Tube BPUT X=byte to write Y=file handle In OS 1.20 this call simply passes through the normal OSBPUT routine &9E (Acorn MOS 1.20 & Acorn MOS 2.00 only) Read from Speech Processor Either Y=speech chip status register Y=byte read from PHROM if a 'read command' was previously written (Electron OS only) Passed as an unknown osbyte to the paged ROMs &9F (Acorn MOS 1.20 & Acorn MOS 2.00 only) Write to Speech Processor Y=data to write (Electron OS only) Passed as an unknown osbyte to the paged ROMs &A0 (Acorn MOS 1.20) Read VDU Variable This call returns variable number X in registers X and Y In OS 1.20 the data starts at &300, but this is machine dependant &A1 (Acorn MOS 3.20) Read CMOS RAM X=byte to read and on exit Y=byte read &A2 (Computer Concepts GXR) X=0 Disable GXR (version 1.xx), Enable GXR (version 2.xx) X=128 Enable GXR (version 1.xx), Disable GXR (version 2.xx) (Acorn MOS 3.20) Write CMOS RAM X=byte to read with Y=byte to write &A3 Reserved for applications software X=242 (Acornsoft GXR 1.20) Y=0 resets the dot-dash pattern & length to defaults Y=1..64 set dot dash pattern repeat length Y=65 return status returns X=b0..5 current dot dash pattern repeat length (0 means 64 though) b6 if set flood fill is always active b7 if set GXR ROM is turned on Y=number of pages allocated to sprites Y=66 return info on current sprite returns X=pixel width Y=pixel height if X=Y=0 then the ROM is not fitted, or no sprite is selected X=242 (RISC OS 1.00) Y=0 resets the dot-dash pattern & length to defaults Y=1..64 set dot dash pattern repeat length Y=65 return status returns X=b0..5 current dot dash pattern repeat length (0 means 64 though) b6 if set flood fill is always active b7 if set sprites are always active Y=66 return info on current sprite returns X=pixel width Y=pixel height X=243 (65Tube emulator) Y=4 find code address, on exit if Y<>0, XY=address to jump to. Called on Tube reset, *BASIC and NMIs to ask for any code entry address Y=6 find *command to execute, on exit if Y<>0, XY=>*command to execute. Called on Tube reset to ask for any startup command. X=255 (VIEW) Y=1 read VIEW's ROM workspace byte at &DF0+romnum. Y=&81 set VIEW's ROM workspace byte at &DF0+romnum to &80. &A4 (Acorn MOS 3.20) Check Processor Type X and Y point to the code to check If the value at offset &06 is not a language ROM the error 'This is not a language' is raised If the value at offset &06 (bits 0..3) is not 6502 code or BASIC then the error 'I cannot run this code' is raised. Other processors should check for their appropriate CPU value in bits 0..3. &A5 (Acorn MOS 3.20) Read output Cursor Position On exit X and Y are the output cursor position used during cursor editing