Hex Availability and use ------------------------------------------------------------------------------ &00 (Acorn MOS 0.10) OS Version Number Report X=0 Report version number as an error X=1 Return machine type 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 ARM Springboard &01 (Acorn MOS 1.00) Write User Flag (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 Unused &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 ULA setting (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 ULA setting (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 Color 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 Color 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 for default &0C (Acorn MOS 0.10) Auto Repeat Period (exits with X=old value) X=delay between key repeats in cs,or 0 for default &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 completed internet transmission request (DCI2 only) X=28 portable battery management unit X=29 reserved for 3rd party use X=30 unallocated X=31 unallocated This call decrements the respective count for the event.When it finally reaches zero the event is stopped. &0E (Various) 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 shadow RAM) Read base of display RAM As per OSByte &84, except the value returned takes into account the RAM board being active. &21 (Watford 32K shadow RAM) Read base of display RAM for a given mode As per OSByte &85, except the value returned takes into account the RAM board being active. &22 (Watford 32K shadow RAM) Switch shadow RAM region This permits the shadow RAM region to be manually paged out so that user programs can access the RAM, though the routine calling this OSByte must itself be below &3000 otherwise it will also be paged out. X=b0=0 to select BBC motherboard RAM =1 to select the shadown RAM board b6=0 to write the current state =1 to read the current state (returned in X) b7=0 force the setting =1 use the internal 8 deep stack (b6 determines whether to push/pull) &23 (Watford 32K shadow RAM) Return location of support firmware workspace X & Y contain the address below PAGE. &27 (Watford 32K shadow RAM) Set buffer number The new buffer number = (old number AND Y) EOR X, to select which buffer will use the remaining 12K of the shadow RAM board as an extended operating system buffer. See OSByte &15 for buffer numbers. &32 (NFS 3.34) Poll transmission of Econet operation On exit X=b7 set if still in progress b6 set if failed b5 set to zero b4-b0 error code if applicable Only one transmit operation can be outstanding so no parameters are required on entry,and X=0 if successful. The defined error codes are &40=line jammed &41=some part of the 4 way handshake failed &42=no scout acknowledge in the 4 way handshake &43=no clock &44=bad transmit control block &33 (NFS 3.34) Poll reception of Econet operation This call checks the status of the Econet receive block whose handle is passed in X. If the call returns with bit 7 of X set a complete block has been received. &34 (NFS 3.34) Delete an Econet receive control block This call deletes the pending Econet receive block whose handle is passed in X. &35 (NFS 3.34) Terminate a *REMOTE session. Taking no parameters,this is directly equivalent to *ROFF. &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 (???) Terminal Function &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 &60 (Terminal 1.20) Used for communication with service code residing in the I/O processor. X=b7 set for INSV/REMV vector operation (b0 set to install, clear to remove) X=0 turn off receive flow control X=1 turn on receive flow control X=2 turn off transmit flow control X=3 turn on transmit flow control X=4..127 aliases of commands 2 and 3 &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. &6E (Watford DFS pre 1.43 and DDFS pre 1.53) Set Double step mode for drives,allowing allows a 40 track disc to be read in an 80 track drive. (NB. Double Step mode should not be used to write to a 40 track disc as the results could be unpredictable when the disc is subsequently read on a 40 track drive.) Y=0 X= Single Step Y=&FF X= Double Step. This was later withdrawn in favour of *OPT40 and *OPT80 commands &6F (Watford DFS post 1.43 and DDFS post 1.53) Read last drive used for *LOAD or *RUN operations X= on exit &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 Y=0 X=0 force use of shadow memory on future mode changes X=1 only use shadow memory if mode number is > 127 &73 (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 &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 simulates pressing the 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 X=file handle On exit X=0 it the EOF has not been reached,otherwise it has.