Hex Description and earliest availability ------------------------------------------------------------------------------ &00 Read host/OS type (Acorn MOS 0.10) On entry: X=0 Report host OS/type as an error, error number 249 X>0 Return host/OS type in X On exit: X=0 Electron/OS 1.00 or Communicator X=1 BBC OS 1.20/American BBC X=2 BBC B+ X=3 Master 128 X=4 Master ET X=5 Master Compact X=6 Arthur/RISC OS system X=7 Springboard X=8 UNIX system X=9 6809 with Unix-style file system X=13 6809 with BBC-style file system X=28 Commodore 64 X=29 Texas Instruments Calculator X=30 Amstrad CPC X=31 Sinclair Spectrum X=32 DOS/Windows Note that this is the *host* system, *NOT* the system the program is running on. For example, if the program is running on a 6502 coprocessor attached to a RISC OS computer, then X will be returned holding 6. The return value is also a bitmap of the host's functionality: X=%xx0x0xxx: BBC filenames: :D.$.directory.leafname/ext X=%xx0x1xxx: Unix filenames: /directory/leafname.ext X=%xx1xxxxx: DOS/Windows filenames: D:\directory\leafname.ext &01 Write and Read User Flag/Exit status (Acorn MOS 1.00) On entry: X=value to write On exit: X=old value This flag is unused by the OS, and is simply there to provide an OSBYTE location without the user needing to write OSBYTE decoding code. It is commonly used to set an 'exit value' from a program when it terminates, and that value can be read by the next program. &02 Specify Input Stream (Acorn MOS 1.00) On entry: X=0 Use the keyboard for input X=1 Use the serial circuit for input X=2 Use the keyboard for input, but listen to the serial port as well so that bytes are accepted and simply buffered where they can be read using buffer input calls or changing to *FX2,1. On exit: X=old input stream (ie, b0 of old value) &03 Specify Output Stream(s) (Acorn MOS 1.00) On entry: X=b0=1 enable serial driver b1=1 disable VDU driver b2=1 disable VDU printer stream b3=1 enable printer (regardless of VDU2/VDU3 state) b4=1 disable spooled output b5=1 calls VDUXV instead of VDU drivers (RISC OS 1.00) b6=1 disable printer, unless VDU1 is used b7 unused Notes: b1 is not the same as issuing VDU21, as the printer remains active throughout. b3 is not the same as issuing VDU2, as all bytes except the printer ignore character are put in the printer stream. Of course b2 and b6 must also be clear! On exit: X=old value &04 Define action of cursor editing keys (Acorn MOS 0.10) On entry: X=0 Cursor keys have editing effect (default) X=1 Cursor keys return ASCII values 135-139 X=2 Cursor keys become soft keys 11-15 X=3 Cursor keys emulate the joystick (with copy acting as 'FIRE') (Acorn MOS 5.00) On exit: X=old value Note: cursor keys are any keycode with bit 7 set and b0-b3>10, ie (keycode AND &8F)>&8A, so includes &8B-F, &9B-F, &EB-F, etc. &05 Printer Driver Type (Acorn MOS 0.10) On entry: X=0 Null printer (sink) X=1 Parallel printer X=2 Serial printer X=3 User printer driver X=4 Net printer X>4 User printer driver ID 5+ On exit: X=old value &06 Printer Ignore Character (exits with X=old value) (Acorn MOS 0.10) On entry: X=character not to send to printer On exit: X=old value Note: To print all characters you would normally use X=0, but note that actually filters out CHR$0. MOS 3.00 and later implement the ability to filter out no characters at all. &07 RS423 Baud Receive rate (Acorn MOS 0.10) On entry: X=0 9600 (default) X=1 75 X=5 2400 X=2 150 X=6 4800 X=3 300 X=7 9600 X=4 1200 X=8 19200 (RISC OS 1.00) (RISC OS 3.50) X=9 50 X=16 38400 X=10 110 X=17 57600 X=11 134.5 X=18 115200 X=12 600 X=13 1800 X=14 3600 X=15 7200 On exit: X=old setting &08 RS423 Baud Transmit Rate (Acorn MOS 0.10) On entry: X=0 9600 (default) X=1 75 X=5 2400 X=2 150 X=6 4800 X=3 300 X=7 9600 X=4 1200 X=8 19200 (RISC OS 1.00) (RISC OS 3.50) X=9 50 X=16 38400 X=10 110 X=17 57600 X=11 134.5 X=18 115200 X=12 600 X=13 1800 X=14 3600 X=15 7200 On exit: X=old setting &09 First Colour Duration (Acorn MOS 0.10) On entry: X=duration of first flash colour in cs, or 0 to hold still On exit: X=old value &0A Second Colour Duration (Acorn MOS 0.10) On entry: X=duration of second flash colour in cs, or 0 to hold still On exit: X=old value &0B Auto Repeat Delay (Acorn MOS 0.10) On entry: X=delay before keys start to autorepeat in cs, or 0 to disable On exit: X=old value &0C Auto Repeat Period (Acorn MOS 0.10) On entry: X=delay between key repeats in cs, or 0 for default delay and repeat On exit: X=old value &0D Disable Event (Acorn MOS 1.00) On entry: X=0 output buffer empty event X=1 input buffer full X=2 character entering buffer X=3 ADC conversion complete X=4 vsync event X=5 interval timer crossed 0 X=6 ESCAPE pressed event X=7 RS423 error X=8 network event X=9 user event X=32 PRISMA vsync event (PRISMA graphics system) (RISC OS 1.00) X=10 mouse button press/release X=11 key press/release X=12 sound system reached start of bar X=13 PC emulator X=14 Econet receive complete X=15 Econet transmit complete X=16 Econet OS remote procedure called X=17 MIDI system X=18,20,23 reserved X=19 internet event X=21 expansion event X=22 device overrun event X=24 driver received frame for internet (DCI2 only) X=25 driver complteted internet transmission request (DCI2 only) X=28 portable battery management unit This call decrements the respective count for the event. When it finally reaches zero the event is stopped. <-- check that On exit: X=old value &0E Enable Event (Acorn MOS 1.00) On entry: X=0 output buffer empty event X=1 input buffer full X=2 character entering buffer X=3 ADC conversion complete X=4 vsync event X=5 interval timer crossed 0 X=6 ESCAPE pressed event X=7 RS423 error X=8 network event X=9 user event X=32 PRISMA vsync event (PRISMA graphics system) (RISC OS 1.00) X=10 mouse button press/release X=11 key press/release X=12 sound system reached start of bar X=13 PC emulator X=14 Econet receive complete X=15 Econet transmit complete X=16 Econet OS remote procedure called X=17 MIDI system X=18,20,23 reserved X=19 internet event X=21 expansion event X=22 device overrun event X=24 driver received frame for internet (DCI2 only) X=25 driver complteted internet transmission request (DCI2 only) X=28 portable battery management unit This call increments the count for the chosen event. Nonzero count means that the event will be enabled. <-- check that On exit: X=old value &0F Flush all buffers/input buffer (Acorn MOS 0.10) On entry: X=0 Flush all buffers X=1 Flush just the input buffers &10 Set maximum number of ADC channel (Acorn MOS 0.10) On entry: X=0 no ADC sampling takes place X=1..4 sets the maximum channel number to sample On exit: X=old value &11 Force an ADC conversion (Acorn MOS 1.00) On entry: X=channel number to start conversion on On exit: X=channel number conversion will start on &12 Reset function key definitions (Acorn MOS 1.00) &13 Wait for Vertical Retrace (Acorn MOS 1.00) This call returns when the electron beam starts drawing another field &14 Explode defined character font RAM and reset characters &20-&7F (Acorn MOS 1.00) On entry: X=0 characters &80-&9F only are exploded (default) X=1 characters &80-&BF are exploded X=2 characters &80-&DF are exploded X=3 characters &80-&FF are exploded X=4 characters &20-&3F, &80-&FF are exploded X=5 characters &20-&5F, &80-&FF are exploded X=6 characters &20-&FF are exploded X>6 characters &20-&FF are exploded Characters &20-&7F are reset for any value of X. If a Tube coprocessor is enabled then the font is fully exploded. If an attempt is made to redefine a character that is not exploded then the definition of a corresponding character in a section of the font that is exploded is changed and the character will then map to several places within the font. On exit: BBC: X=return from Service Call &11 - &FF if unclaimed, Y=new OSHWM Master: X=0, Y=preserved RISC OS: X=1 - first font bank reset, Y=3 - number of banks reset BB4W: X=32 (character under cursor) &15 Flush Selected Buffer (Acorn MOS 1.00) On entry: X=0 Keyboard X=1 Serial input X=2 Serial output X=3 Printer X=4 Sound channel 0 X=5 Sound channel 1 X=6 Sound channel 2 X=7 Sound channel 3 X=8 Speech (RISC OS 1.00) X=9 Mouse &16 Increment Polling Semaphore (Electron OS & Acorn MOS 3.20) This call increments a counter, which if nonzero will cause ROM Service Call &15 to be sent paged ROMs 100 times a second. This allows a way for ROMs to poll hardware which doesn't offer interrupts. &17 Decrement Polling Semaphore (Electron OS & Acorn MOS 3.20) This call decrements a counter, which when zero will stop ROM Service Call &15 polling calls from being sent to ROMs at 100Hz. &18 Select external sound system (Electron OS only) This call enters with 'some parameter' in X which will be used to wake up additional sound hardware on the Electron. &19 Reset a group of font definitions (Acorn MOS 3.20) On entry: X=0 reset characters &20-&FF (banks 1 to 7) X=1 reset characters &20-&3F (bank 1) X=2 reset characters &40-&5F (bank 2) X=3 reset characters &60-&7F (bank 3) X=4 reset characters &80-&9F (bank 4) X=5 reset characters &A0-&BF (bank 5) X=6 reset characters &C0-&DF (bank 6) X=7 reset characters &E0-&FF (bank 7) X>7 Master: ignored X=7-15 Compact: as X=0-7 X>15 Compact: ignored On exit: BBC: X=&FF, Y=preserved, unless claimed Master: X=0, Y=preserved Compact: the call is passed to sideways ROMs before the MOS, if the sideways ROM call is claimed, X is returned holding the returned value, otherwise X=0, Y=preserved, as on the Master RISC OS: X=first font bank reset, Y=number of banks reset In effect, if X=0 on entry, X=1 on exit if X>0 on entry, X=preserved on exit (first passed to International module) BB4W: X=32 (character under cursor) &19 Output a speech allophone (Watford Speech) On entry: Y=0, X=allophone number - output allophone Y=1, X=word number - output a word from dictionary 1 Y=2, X=word number - output a word from dictionary 1 Y=3, X=word number - output a word from dictionary 1 Y>3, - ignored, allowing other ROMs to respond to and pass to OSBYTE &19,x,0 This is used internally by Watford Speech. SOUND &20 should be used in preference to this call as Y cannot be passed to OSBYTE calls <&80. &19 Handset detection (Communicator) &20 Read top of memory (Watford 32K RAM) Used internally, use OSBYTE &82 instead. &21 Read top of memory for screen mode (Watford 32K RAM) Used internally, use OSBYTE &83 instead. &22 Read/Write RAM switch (Watford 32K RAM) Used internally, use OSBYTE &6F instead. &23 Read Watford RAM workspace address in X and Y. (Watford 32K RAM) &24 Read/Write RAM buffer bank number. (Watford 32K RAM) New value = (old value AND Y) EOR X. &32 Poll network transmit (NetFS) On exit X=transmission control byte, b7=not completed, b6=transmission failed, b3-b0=failure code &33 Poll network receive (NetFS) X=receive control block number On exit X=reception control byte, b7=reception completed, &34 Delete receive control block (NetFS) X=receive control block number &35 Disconnet REMOTE connection (NetFS) &3F Reload CCP and BDOS (SJ ZNOS) &43 Enter CNC control program (ParaMax CNC system) &44 Test sideways RAM presence (Acorn MOS 2.00) On exit X=b0 set if slot 4 is RAM b1 set if slot 5 is RAM b2 set if slot 6 is RAM b3 set if slot 7 is RAM &45 Test PSEUDO/Absolute usage (Acorn MOS 2.00) Sideways RAM can either be allocated as holding ROM images or as extended memory using pseudo addressing.This call identifies RAM useage: On exit X=b0 set if slot 4 is being used as pseudo RAM b1 set if slot 5 is being used as pseudo RAM b2 set if slot 6 is being used as pseudo RAM b3 set if slot 7 is being used as pseudo RAM &46 Read/write country number (International ROM, RISC OS 1.00) On entry: X=0..126: set the country number X=10 Greece X=20 Turkey X=1 UK X=11 Sweden X=21 Arabic X=2 Master X=12 Finland X=22 Ireland X=3 Compact X=13 Unused X=23 Hong Kong X=4 Italy X=14 Denmark X=24 Russia X=5 Spain X=15 Norway X=25 Russia2 X=6 France X=16 Iceland X=26 Israel X=7 Germany X=17 Canada1 X=27 Mexico X=8 Portugal X=18 Canada2 X=28 LatinAm X=48 USA X=9 Esperanto X=19 Canada X=127 to read the current value On exit: X=0 if the country was invalid &47 Read/write alphabet/keyboard number (International ROM, RISC OS 1.00) On entry: X=0..126 set the alphabet number X=100 BFont X=105 Cyrillic X=101 Latin1 X=106 Arabic X=102 Latin2 X=107 Greek X=103 Latin3 X=108 Hebrew X=104 Latin4 X=120 Cyrillic2 X=127 reads the alphabet number X=128..254 set the keyboard number X=254 standard archimedes keyboard X=253 A4 internal or PC style keyboard X=255 read the keyboard number On exit: X=0 if the alphabet or keyboard was invalid &50 SpectROM read System VIA (SpectROM) Internal call to read System VIA T2 counter. &5A Find/set ROM status (JGH ROM System) X=ROM id, Y=0 Enable ROM Y=1 Disable ROM Y=255 Read ROM status, b7=ROM absent, b6=ROM disabled X=0 Display all ROM titles &5A Enable/disable E00 ADFS (Electron PRES E00 ADFS) X=250 - Kill ADFS 1.00. Resets machine if 1.00 was active. X=251 - X=252 - Kill current ADFS and restart 1.2x X=253 - Kill ADFS 1.2x and restart ADFS 1.00 or 1.1x X=254 - X=255 - X<20 - &61 Check page timeout (HKSET) &62 Poll received page status (HKSET) Y=handle - &10 or &12 (will not work over Tube, as X should have been used) On exit X=status: b0=timeout, b6=page arrived X=&FE if neither channel open, X=&FF is unknown handle &64 Enter SPY debugger, examining memory at YX. (SYSTEM SPY) &6A Select pointer/activate mouse (RISC OS 1.00) On entry: X=b0..2 select pointer defined by OSWord 21 (or 0 for off) X=b7 unlink visible pointer from mouse if set On exit: X=old value &6B External/Internal 1MHz Bus (Acorn MOS 3.20 & Acorn MOS 5.10 only) On entry: X=0 select external bus running at 2MHz X=1 select internal bus running at 1MHz This call allows the selection of either the external cartridge slot style of '1MHz' bus, or the internal 1MHz bus under the keyboard. In the case of the Master Compact X=1 has no effect as it has no connectors under the keyboard. On exit: X is preserved &6C Main/Shadow RAM Usage (Acorn MOS 3.20) On entry: X=0 Main memory appears from &3000 to &7FFF X=1 Shadow memory appears from &3000 to &7FFF This has immediate effect and allows the user to make use of the 20K of extra RAM for other purposes. &6D Make Temporary FS permanent (Acorn MOS 3.20) This may be necessary if the action the temporary filing system wants to perform requires it to (for example) claim NMIs, which only the current FS may do. Has no parameters. &6E Output to ROMSTROBE (Electron Plus 1) On entry: X=value to write On exit: X=old value The new value is written to the ROMSTROBE RAM copy and output to ROMSTROBE, this is at &FC73 on the Electron Plus 1. &6F Read/Write Shadow RAM Switch (Aries B32, Watford 32K RAM) On entry: X: b7=0 no stack operation b7=1 pop state from stack (reading), push state on stack (writing) b6=0 write switch state b6=1 read switch state b0=0 select video RAM b0=1 select shadow RAM On exit: X contains the previous switch state: b0=0 video RAM b0=1 shadow RAM &70 Select Main/Shadow for VDU access (Acorn MOS 3.20) On entry: X=0 Use whatever the default for the current mode is X=1 Use main memory X=2 Use shadow memory (RISC OS 1.00) The value of X can be greater than 2 as well, and instructs the VDU drivers to use the bank at screenbase+(X*modesize) &71 Select Main/Shadow for Display hardware (Various) On entry: X=0 Use whatever the default for the current mode is X=1 Use main memory X=2 Use shadow memory &72 Write to Shadow/Main toggle (Acorn MOS 1.20) On entry: X=0 force use of shadow memory on future mode changes X=1 only use shadow memory if mode number is > 127 (Solidisk ROM/RAM Extension) X=255 never use shadow memory &73 Select shadow RAM bank used (Solidisk ROM/RAM Extension) On entry: X=0 Shadow bank 8 X=1 Shadow bank 9 (Electron OS only) Blank/restore palette On entry: X=0 restores the palette X<>0 sets the whole palette to black if is high resolution mode Software using NMIs in high res modes can prevent snow appearing on the screen during NMIs (due to ULA reuse) by blanking the palette &74 Reset internal sound system (Electron OS only) This call enters with 'some parameter' in X which resets the built-in sound system (Solidisk ROM/RAM Extension) Determine shadow RAM system installed On entry: no parameters On exit: X='S' - Solidisk ROM/RAM extension X unchanged - No shadow RAM or Acorn shadow RAM &75 Read VDU Status Byte (Acorn MOS 1.00) On entry: no parameters On exit: X=b0 Print output enabled by VDU2 b1 Scrolling disabled (MOS 1.20+) b1 Unused b2 Paged scrolling selected by VDU14 b3 Text window in force ie. software scrolling b4 In a shadow mode b5 In VDU5 mode b6 Cursor editing in progress b7 Screen disabled with VDU21 &76 Reflect keyboard status in LEDs (Acorn MOS 1.20) If the keyboard status byte (CAPs lock etc...) is written to with OSBYTE 202 then the LEDs should be updated by using this call. Under normal circumstances the LEDs look after themselves When calling within the I/O processor, MOS 1.20 returns Cy=Escape pending MOS 2.00 returns Cy=CTRL key pressed &77 Close all Spool/Exec files (Acorn MOS 1.20) &78 Key Pressed Data (Acorn MOS 1.20) On entry: X=internal number of 1st key pressed Y=internal number of 2nd key pressed (only from I/O processor) This writes the rollover key numbers, but will not normally cause any keys to be inserted in the buffer as it does not affect the rollover counter. This is normally used by filing systems to acknowledge a key-Break reset. (RISC OS 1.00) X=0 Y=0 locks the rollover mechanism until all keys are released &79 Keyboard Scan (Acorn MOS 1.20) On entry: X>&7F: internal keynumber EOR &80 for single key check On exit: X<0 if the key was being pressed On entry: X<&80: lowest internal keynumber to start scanning a range of keys On exit: X=earliest keynumber being pressed or &FF for none &7A Keyboard Scan from &10 (Acorn MOS 1.20) Simply performs OSBYTE &79 with X=16 to scan all non-modifier keys &7B Printer Dormancy Warning (Acorn MOS 1.20) On entry: X=3 (printer buffer number) informs the OS that the printer driver has gone dormant and any future characters being printed will wake it up again &7C Clear ESCAPE Condition informing Tube if necessary (MOS 0.10) &7D Set ESCAPE conditon (MOS 0.10) This call is similar to pressing the current ESCAPE key, informing the Tube if necessary, but does not cause an ESCAPE event. &7E Acknowledge ESCAPE condition (MOS 0.10) On exit: X=0 there was no ESCAPE condition X<>0 ESCAPE condition sucessfully cleared This call acknowledges any ESCAPE condition, this will clear the ESCAPE condition, and then if Escape actions are enabled with OSBYTE 230 they will be performed. &7F Check for EOF. Called by BASIC's =EOF function. (MOS 0.10) On entry: X=file handle On exit: X=0 if the EOF has not been reached, X<>0 if EOF has been reached.