Hex Availability and use ------------------------------------------------------------------------------ &00 (Acorn MOS 0.10) OS Version Number Report X=0 Report version number as an error X=1 Return version number in X On exit X=0 Electron/OS 1.00 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 ARM based machine X=7 Springboard X=8 UNIX system X=30 Amstrad CPC X=31 Sinclair Spectrum X=32 DOS &01 (Acorn MOS 1.00) Write and Read User Flag/Exit status (exits with X=old value) 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 &02 (Acorn MOS 1.00) Specify Input Stream (exits with X=b0 of old value) 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 too such that bytes are accepted and simply buffered for later inspection &03 (Acorn MOS 1.00) Specify Output Stream(s) (exits with X=old value) 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 unused b6=1 disable printer, unless VDU1 is used b7 unused (Risc OS 1.00) b5=1 calls VDUXV instead of VDU drivers 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! &04 (Acorn MOS 0.10) Define action of cursor editing keys (exits with X=old value) 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 (Acorn MOS 5.00 only) X=3 Cursor keys emulate the joystick (with copy acting as 'FIRE') &05 (Acorn MOS 0.10) Printer Driver Type (exits with X=old value) 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+ &06 (Acorn MOS 0.10) Printer Ignore Character (exits with X=old value) X=character number not to print or 0 to print all characters &07 (Acorn MOS 0.10) RS423 Baud Receive rate X=0 9600 (default) X=1 75 X=2 150 X=3 300 X=4 1200 X=5 2400 X=6 4800 X=7 9600 X=8 19200 On exit X=old baud rate (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 (Acorn MOS 0.10) RS423 Baud Transmit Rate X=0 9600 (default) X=1 75 X=2 150 X=3 300 X=4 1200 X=5 2400 X=6 4800 X=7 9600 X=8 19200 On exit X=old baud rate (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 (Acorn MOS 0.10) First Colour Duration (exits with X=old value) X=duration of first flash colour in cs, or 0 to hold still &0A (Acorn MOS 0.10) Second Colour Duration (exits with X=old value) X=duration of second flash colour in cs, or 0 to hold still &0B (Acorn MOS 0.10) Auto Repeat Delay (exits with X=old value) X=delay before keys start to autorepeat in cs, or 0 to disable &0C (Acorn MOS 0.10) Auto Repeat Period (exits with X=old value) X=delay between key repeats in cs, or 0 for default delay and repeat &0D (Acorn MOS 1.00) Disable Event (exits with X=old value) Y=0 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 error X=9 user event (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. &0E (Acorn MOS 1.00) Enable Event (exits with X=old value) This call increments the count for the chosen event.Non zero count means that the event will be enabled. &0F (Acorn MOS 0.10) Flush all buffers/input buffer X=0 Flushes all buffers X=1 Flushes just the input buffer &10 (Acorn MOS 0.10) Set maximum number of ADC chanel (exits with X=old value) X=0 no ADC sampling takes place X=1..4 sets the maximum channel number to sample &11 (Acorn MOS 1.00) Force an ADC conversion (exits with X=channel chosen) X=channel number to start conversion on &12 (Acorn MOS 1.00) Reset F-key definitions &13 (Acorn MOS 1.00) Wait for Vertical Retrace This call returns when the electron beam starts drawing another field &14 (Acorn MOS 1.00) Explode user defined character font RAM (exits with X=new value of OSHWM) X=0 characters &80 to &9F only are exploded (default) X=1 characters &A0 to &BF are exploded X=2 characters &C0 to &DF are exploded X=3 characters &E0 to &FF are exploded X=4 characters &20 to &3F are exploded X=5 characters &40 to &5F are exploded X=6 characters &60 to &7F are exploded Notes If a Tube coprocessor is fitted then all fonts are 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 font that is exploded is changed and the character will then map to several places within the font (Acorn MOS 3.20) Reset to standard user defined character set X=0 resets to the ROM font &15 (Acorn MOS 1.00) Flush Selected Buffer 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 (Electron OS & Acorn MOS 3.20 only) Increment Polling Semaphore This call increments a counter, which if non zero will cause 100 service calls (type &15) per second to be sent the paged ROMs. This allows a way for ROMs to poll hardware which doesn't offer interrupts. &17 (Electron OS & Acorn MOS 3.20 only) Decrement Polling Semaphore This call decrements a counter, which when zero will stop the (type &15) polling calls from being sent to ROMs at 100Hz. &18 (Electron OS only) Select external sound system. This call enters with 'some parameter' in X which will be used to wake up additional sound hardware on the Electron. &19 (Acorn MOS 3.20) Reset a group of font definitions X=0 resets 32-255 X=1 resets 32-63 X=2 resets 64-95 X=3 resets 96-127 X=4 resets 128-159 X=5 resets 160-191 X=6 resets 192-223 X=7 resets 224-255 &20 (Watford 32K RAM) Read top of memory - use OSBYTE &82 instead. &21 (Watford 32K RAM) Read top of memory for screen mode - use OSBYTE &83 instead. &22 (Watford 32K RAM) Read/Write RAM switch - use OSBYTE &6F instead. &23 (Watford 32K RAM) Read Watford RAM workspace address in X and Y. &24 (Watford 32K RAM) Read/Write RAM buffer bank number. New value = (old value AND Y) EOR X. &32 (NetFS) Poll network transmit On exit X=transmission control byte, b7=not completed, b6=transmission failed, b3-b0=failure code &33 (NetFS) Poll network receive X=receive control block number On exit X=reception control byte, b7=reception completed, &34 (NetFS) Delete receive control block X=receive control block number &35 (NetFS) Disconnet REMOTE connection &3F (SJ ZNOS) Reload CCP and BDOS &43 (ParaMax CNC system) Enter CNC control program &44 (Acorn MOS 2.00) Test sideways RAM presence 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 (Acorn MOS 2.00) Test PSEUDO/Absolute usage 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 (Risc OS 1.00) Read/write country number (on exit X=0 if the country was invalid) X=1 UK X=2 Master X=3 Compact X=4 Italy X=10 Greece X=16 Iceland X=22 Ireland X=28 LatinAm X=5 Spain X=11 Sweden X=17 Canada1 X=23 Hong Kong X=48 USA X=6 France X=12 Finland X=18 Canada2 X=24 Russia X=7 Germany X=13 Unused X=19 Canada X=25 Russia2 X=8 Portugal X=14 Denmark X=20 Turkey X=26 Israel X=9 Esperanto X=15 Norway X=21 Arabic X=27 Mexico Or use X=127 to read the current value &47 (Risc OS 1.00) X=0..126 set the alphabet number X=100 BFont X=101 Latin1 X=102 Latin2 X=103 Latin3 X=104 Latin4 X=105 Cyrillic X=106 Arabic X=107 Greek X=108 Hebrew X=120 Cyrillic2 X=127 reads the alphabet number X=128..254 sets the keyboard number X=254 standard archimedes keyboard X=253 A4 internal or PC style keyboard X=255 read the keyboard number &5A (JGH ROM System) Find/set ROM status X=ROM id, Y=0 Enable ROM Y=1 Disable ROM Y=255 Read ROM status, b7=ROM absent, b6=ROM disabled &5A (Electron PRES E00 ADFS) Enable/disable E00 ADFS X=250 - Kill ADFS 1.00, resets machine if ADFS active X=253 - Kill ADFS 1.2x and restart ADFS 1.xx X=254 - Kill current ADFS and restart ADFS 1.2x &61 (HKSET) Check page timeout &62 (HKSET) Poll received page status 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 (SYSTEM SPY) Enter SPY debugger, examining memory at YX. &6A (Risc OS 1.00) Select pointer/activate mouse (on exit X=old value) X=b0..2 select pointer defined by OSWord 21 (or 0 for off) X=b7 unlink visible pointer from mouse if set &6B (Acorn MOS 3.20 & Acorn MOS 5.10 only) External/Internal 1MHz Bus (on exit X is preserved) Y=0 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 &6C (Acorn MOS 3.20) Main/Shadow RAM Usage Y=0 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 (Acorn MOS 3.20) Make Temporary FS permanent (no parameters) 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. &6F (Aries B32, Watford 32K RAM) Read/Write Shadow RAM Switch 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 (Acorn MOS 3.20) Select Main/Shadow for VDU access Y=0 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 (Various) Select Main/Shadow for Display hardware Y=0 X=as per OSByte &70 The value of X defines which bank the hardware will output &72 (Acorn MOS 1.20) Write to Shadow/Main toggle 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 (Solidisk ROM/RAM Extension) Select shadow RAM bank used X=0 Shadow bank 8 X=1 Shadow bank 9 (Electron OS only) Blank/restore palette 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 (Electron OS only) Reset internal sound system 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 exit: X='S' - Solidisk ROM/RAM extension X unchanged - No shadow RAM or Acorn shadow RAM &75 (Risc OS 1.00) Read VDU Status Byte X=b0 Print output enabled by VDU2 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 (Acorn MOS 1.20) b1 Scrolling disabled &76 (Acorn MOS 1.20) Reflect keyboard status in LEDs 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 (Acorn MOS 2.00 only) Read ctrl/Shift keys Returns with processor status C=1=CTRL key pressed N=1=SHIFT key pressed &77 (Acorn MOS 1.20) Close all Spool/Exec files &78 (Acorn MOS 1.20) Key Pressed Data X=1st key pressed (internal number) Y=2nd key pressed (internal number) 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 (Risc OS 1.00) X=0 Y=0 locks the rollover mechanism until all keys are released &79 (Acorn MOS 1.20) Keyboard Scan Y=0 X=internal keynumber EOR&80 for single key check On exit X<0 if the key was being pressed Y=0 X=lowest internal keynumber to start at (for a range of keys) On exit X=earliest keynumber being pressed or &FF for none &7A (Acorn MOS 1.20) Keyboard Scan from &10 Simply performs OSByte &79 with X=16 &7B (Acorn MOS 1.20) Printer Dormancy Warning X=3 informs the OS that the printer driver has gone dormant and any future characters being printed will wake it up again &7C (Acorn MOS 0.10) Clear ESCAPE Condition informing Tube if necessary &7D (Acorn MOS 0.10) Set ESCAPE conditon This call is similar to pressing the current ESCAPE key, informing the Tube if necessary, but does not cause an ESCAPE event &7E (Acorn MOS 0.10) Acknowledge ESCAPE Condition This call tries to clear any ESCAPE condition, and (if enabled with OSByte 230) appropriate side effects. On exit X=255 successfully cleared condition X=0 the ESCAPE condition was not cleared (or no ESCAPE condition) &7F (Acorn MOS 0.10) Check for EOF. Called by BASIC's =EOF function. X=file handle On exit X=0 if the EOF has not been reached, otherwise it has.