www.riscos.com Technical Support:
The OS_Word call is very similar to the OS_Byte call. It is also used to read from, or write to, values held in RAM by RISC OS. Much of what is said in the OS_Byte chapter also applies to OS_Word.
You can add new OS_Word calls by installing a routine on the software vector that OS_Word uses - see the chapter entitled Software vectors. Alternatively you can use the Unknown OS_Word service call, although this is not such a good way to do so, and is hence deprecated - see the chapter entitled Modules.
Like OS_Byte, interrupts are disabled when most OS_Word routines are entered.
The major difference between the two calls is that an OS_Word call deals with larger amounts of data than an OS_Byte call. You therefore need to pass your data in a different way.
OS_Word always takes two parameters. R0 is a reason code (as it is for OS_Byte). R1, however, is a pointer to a parameter block. This is an area of memory where you store parameters that you want to pass to OS_Word, and where OS_Word can store its results. The size of the parameter block varies from call to call, and is documented with each OS_Word description. Often the parameter block contains a sub-reason code, which can specify the length of the parameter block; so the size can also vary for a given reason code in R0.
Like OS_Byte, OS_Word is multi-purpose, and covers such areas as reading the time and date, setting the screen's 'palette', and reading the definition of a re-definable character.
There are far fewer OS_Words than OS_Bytes; 0 - 22 is the current range of R0 on entry. Most of these OS_Word calls are provided to ease the task of porting software from the earlier BBC and Master series computers.
You call the OS_Word SWI in exactly the same way as any other SWI. For details see the earlier chapter An introduction to SWIs.
Unlike OS_Byte, no * Command equivalent to OS_Word is provided.
General purpose call to alter status variables, and perform other actions
R0 = reason code
R1 = pointer to parameter block
Interrupts are disabled by the OS_Word decoding routine
Interrupt status is unaltered (ie remains disabled) for most values of R0
Fast interrupts are enabled
Processor is in SVC mode
The action taken by this SWI depends on the reason code passed in R0. In general, OS_Word is used to either read or write a large number of status variables at once. R1 points to a parameter block, the length of which varies depending on the reason code. You should see the individual documentation of each OS_Word for full details. For an index of all OS_Word calls, see the chapter entitled Index of OS_Words