HELP,,$DIR$F[!RootFFcmdtabledFA/5codeF %Vcommands F&final F8flagsKKheader(FD~helpcodeF0helpstring,FмhelptextFǓinfowordpFlpinitF9OS_ModuleFCSOservice FstartFdDswihandler$K#MLSWIs42F'|switable2KCL}modflagsDATA[Modules #wrap off <*Commands=>commands> header> DATAFHelp and command keyword table #Parent header #wrap off Sequence of entries, terminated by a zero byte. Entry: #Indent 2 String ALIGN to word boundary Offset of (or 0 if no code) infoword> Offset of invalid syntax message (or 0) Offset of helptext> (or 0 if no help) DATA5Code associated with a command #Parent cmdtable #wrap off => R0 = pointer to the command tail, which you may not overwrite R1 = number of parameters R12 = pointer to private word R13 = stack pointer R14 = return address \<= R0 = error pointer if anything goes wrong R7-R11 must be preserved DATAV*Commands #Parent !Root #fCode *Modules #f;Indent 4 Lists the modules currently loaded, giving the name and address of the module, and also the address of its workspace. #Indent #fCode *RMClear #f;Indent 4 Deletes all relocatable modules from the RMA. #Indent #fCode *RMEnsure {/}module_title{/} {/}version_number{/} [{/}command{/}] #f;Indent 4 Checks that a module is present and is the given version, or a more modern one. The command is executed if this is not the case. #Indent #fCode *RMFaster {/}module_title{/} #f;Indent 4 Moves a module from ROM to RAM. #Indent #fCode *RMInsert {/}module_title{/} [{/}ROM_section{/}] #f;Indent 4 Reverses the effect of \*Unplug, but does not reinitialise the specified ROM module. #Indent #fCode *RMKill {/}module_title{/}[%{/}instantiation{/}] #f;Indent 4 Kills and deletes a relocatable module. #Indent #fCode *RMLoad /filename/ [{/}module_init_string{/}] #f;Indent 4 Loads and initialises a relocatable module. #Indent #fCode *RMReInit {/}module_title{/} [{/}module_init_string{/}] #f;Indent 4 Reinitialises a relocatable module, reversing the action of \*Unplug if appropriate. #Indent #fCode *RMRun /filename/ [{/}module_init_string{/}] #f;Indent 4 Runs a relocatable module. #Indent #fCode *RMTidy #f;Indent 4 Compacts the RMA and reinitialises all the modules. #Indent #fCode *ROMModules #f;Indent 4 Lists the relocatable modules currently in ROM, along with their status. #Indent #fCode *Unplug [{/}module_title{/} [{/}ROM_section{/}]] #f;Indent 4 Stops the given ROM module being initialised. With no argument, lists the unplugged ROM modules. #Indent DATA&Finalisation code #Parent header #wrap off => R10 = 0: non-fatal, 1: fatal R11 = instantiation number R12 = pointer to private word R13 = supervisor stack pointer \<= Must preserve processor mode and interrupt state Must preserve R7-R11 and R13 #wrap on Processor is in SVC mode. DATAFlags #Parent infoword #wrap off Bit 31 = 1: the string is a filing system command. Bit 30 = 1: the string is to be matched by *Status and *Configure. Bit 29 = 1: help offset refers to a piece of helpcode>. Other flags should be 0. DATAModule header format #Parent !Root #wrap off &00 start> &04 init> &08 final> &0C service> &10 title string &14 helpstring> &18 cmdtable> &1C SWI chunk base number (optional 1) &20 swihandler> (optional 1) &24 switable> (optional 1) &28 SWI decoding code (optional 1) &2C messageTrans file (optional 2) &30 offset to modflags> (optional 2) DATA~Help code #Parent flags #wrap off => R0 = pointer to a buffer R1 = buffer length \<= R1-R6 and R12 can be corrupted DATAHelp string #Parent header #fCode;wrap off {/}module_name{/} {/}Tab{/}[{/}Tab{/}] {/}v.vv{/} ({/}DD{/} /MMM/ {/}YYYY{/}) DATAHelp text #Parent cmdtable The help text is pretty-printed using the internal RISC OS dictionary. #wrap off Special characters: CR ASCII 13 newline TAB ASCII 9 tabulation to the next multiple of 8 columns SPACE ASCII 31 hard space ESC ASCII 27 dictionary entry Some entries of the RISC OS dictionary: #Tab *Token* *String* *Token* *String* 2 " the " 26 "printe" 3 "director" 28 "select" 4 "filing system" 29 "xpression" 5 "current" 31 "sprite" 7 "file" 32 " displays" 8 "default " 33 "free space" 9 "tion" 34 " \{off}" 10 "*Configure " 35 "library" 11 "name" 36 "parameter" 12 " server" 37 "object" 13 "number" 38 " all " 16 " and " 39 "disc" 17 "relocatable module" 40 " to " 19 "sets the " 41 " is " #Tab *Token* *String* 0 /command/ 1 "Syntax: *"{/}command{/} 14 "Syntax: *"{/}command{/}" \<" 27 "Syntax: *"{/}command{/}" \" 30 "Syntax: *"{/}command{/}" [" DATAInformation word #Parent cmdtable #wrap off *Byte* *Contents* 0 Minimum number of parameters 1 OS_GSTrans map for first 8 parameters 2 Maximum number of parameters 3 DATApInitialisation code #Parent header #wrap off => R10 = pointer to environment string R11 = I/O base or instantiation number R12 = pointer to private word R13 = supervisor stack pointer \<= Must preserve processor mode and interrupt state Must preserve R7-R11 and R13 #wrap on Processor is in SVC mode. If private word != 0, this implies reinitialisation. DATAOS_Module (&1E) #Parent !Root #Prefix SWIs #wrap off {*}R0{*} *Meaning* {*}*Command{*} 0 *RMRun 1 *RMLoad 2 3 *RMReInit 4 *RMKill 5 SWIsDescribe> 6 SWIsClaim> 7 SWIsFree> 8 SWIsTidy> *RMTidy 9 *RMClear 10 SWIsInsert> 11 SWIsInsertMove> *RMFaster 12 SWIsExtract> *Modules & *ROMModules 13 SWIsExtend> 14 SWIsInstNew> 15 SWIsInstRename> 16 SWIsInstPref> 17 SWIsExpCard> 18 SWIsLookup> 19 SWIsEnum> 20 SWIsEnumVers> Interrupt status is undefined. Fast interrupts are enabled. Processor is in SVC mode. Re-entrancy is not defined. DATAOService call handler #Parent header #wrap off => R1 = service number R12 = pointer to private word \<= R1 can be set to 0 if the service is being claimed Registers mustn't be corrupted unless they're returning values R12 may be corrupted #wrap on Processor is in SVC or IRQ mode. Entry point may be re-entered by RISCOS. DATAStart code #Parent header #wrap off => R0 = pointer to command string R12 = pointer to private word for preferred instantiation #wrap on Processor is in USR mode. Does not return. DATADSWI handler #Parent header #wrap off => R0-R9 are passed from the SWI caller by RISC OS R11 = SWI number modulo Chunk Size (i.e. 0-63) R12 = pointer to private word R13 = supervisor stack pointer R14 contains the flags of the SWI caller \<= R0-R9 are returned to SWI caller by RISC OS R10-R12 may be corrupted DIR$ F؈Claimh!FQClear!F Delete"Fa]ءDescribe\#F[$ Enter8$FxEnum%F\إEnumVers`'FvذExpCard(F~دExtend(F2IExtract *FؕFree*FInsertx+F2رInsertMove,,F؛InstNew,F1)؎InstPrefX-F:ضInstRename.F}~ ZLoadl/F Lookup|0F2 ةReInit(1F7 ػRun1FPTidyDATAClaim (OS_Module 6) #Parent OS_Module #wrap off => R0 = 6 (reason code) R3 = required size \<= R2 = pointer to claimed block DATAQClear (OS_Module 9) #Parent OS_Module #wrap off => R0 = 9 (reason code) DATADelete (OS_Module 4) #Parent OS_Module #wrap off => R0 = 4 (reason code) R1 = pointer to module name #wrap on Finalises the module, frees any workspace pointed at by the private word, delinks the module and frees the space it was occupying. DATADescribe RMA (OS_Module 5) #Parent OS_Module #wrap off => R0 = 5 (reason code) \<= R2 = size of largest block available R3 = total amount free in RMA DATAEnter (OS_Module 2) #Parent OS_Module #wrap off => R0 = 2 (reason code) R1 = pointer to module name R2 = pointer to parameters #wrap on Sets user mode and enters the module (start address). Does not return. DATAEnumerate ROM modules (OS_Module 19) #Parent OS_Module #wrap off => R0 = 19 (reason code) R1 = module number (0 to start full enumeration) R2 = ROM section (-1 to start full enumeration) \<= R1 = module number of found module + 1 R2 = ROM section of found module R3 = pointer to module name R4 = -1 (unplugged), 0 (dormant), 1 (active), 2 (running) R5 = chunk number DATAEnumerate ROM modules with version (OS_Module 20) #Parent OS_Module #wrap off => R0 = 20 (reason code) R1 = module number (0 to start full enumeration) R2 = ROM section (-1 to start full enumeration) \<= R1 = module number of found module + 1 R2 = ROM section of found module R3 = pointer to module name R4 = -1 (unplugged), 0 (dormant), 1 (active), 2 (running) R5 = chunk number R6 = BCD version number DATAAdd expansion card module (OS_Module 17) #Parent OS_Module #wrap off => R0 = 17 (reason code) R1 = pointer to environment string R2 = chunk number R3 = ROM section DATAExtend block (OS_Module 13) #Parent OS_Module #wrap off => R0 = 13 (reason code) R2 = pointer to block R3 = change in size \<= R2 = pointer to new allocated block DATAIExtract module information (OS_Module 12) #Parent OS_Module #wrap off => R0 = 12 (reason code) R1 = module number, or 0 for first call R2 = instantiation number, or 0 for all \<= R1 = updated module number R2 = updated instantiation number R3 = module base R4 = private word R5 = pointer to instantiation postfix DATAFree (OS_Module 7) #Parent OS_Module #wrap off => R0 = 7 (reason code) R2 = pointer to block #wrap on Frees a block claimed from the RMA. DATAInsert module from memory (OS_Module 10) #Parent OS_Module #wrap off => R0 = 10 (reason code) R1 = pointer to start of module #wrap on The word at address R1-4 must contain the length of the module. DATAInsert module from memory and move into RMA (OS_Module 11) #Parent OS_Module #wrap off => R0 = 11 (reason code) R1 = pointer to start of module R2 = length of module DATACreate new instantiation (OS_Module 14) #Parent OS_Module #wrap off => R0 = 14 (reason code) R1 = pointer to new instantiation name + parameters DATAMake preferred instantiation (OS_Module 16) #Parent OS_Module #wrap off => R0 = 16 (reason code) R1 = pointer to instantiation name DATARename instantiation (OS_Module 15) #Parent OS_Module #wrap off => R0 = 15 (reason code) R1 = pointer to current instantiation name R2 = pointer to new instantiation name DATAZLoad (OS_Module 1) #Parent OS_Module #wrap off => R0 = 1 (reason code) R1 = pointer to pathname + parameters #wrap on Claims a block of the RMA, loads the file, checks the file type and the header, [SWIsDelete> the duplicate module], sets the workspace word to 0, initialises the module and adds the module to the module list. DATA Look-up module name (OS_Module 18) #Parent OS_Module #wrap off => R0 = 18 (reason code) R1 = pointer to full instantiation name \<= R1 = module number R2 = instantiation number R3 = pointer to module code R4 = private word R5 = pointer to postfix string DATAReinitialise (OS_Module 3) #Parent OS_Module #wrap off => R0 = 3 (reason code) R1 = pointer to pathname + parameters #wrap on SWIsLoad> the module. DATARun (OS_Module 0) #Parent OS_Module #wrap off => R0 = 0 (reason code) R1 = pointer to pathname + parameters #wrap on Loads, initialises and enters the module. Does not return. DATAPTidy (OS_Module 8) #Parent OS_Module #wrap off => R0 = 8 (reason code) DATASWI decoding table #Parent header #wrap off SWI group prefix Name of 0th SWI Name of 1st SWI Name of {/}n{/}th SWI 0 byte DATA}Module flags word #Parent header Bit 0 set means that the module is 32-bit compatible. The other bits must be clear.