Difference between revisions of "Allocations"

From BeebWiki
Jump to: navigation, search
(Moved here from Talk:OSWORD)
 
m (typo!)
Line 1: Line 1:
[[Category:MOSAPI]][[Category:OSWORD]][[Category:OSBYTE]]
+
[[Category:MOS_API]][[Category:OSWORD]][[Category:OSBYTE]]
 
==Allocating new OSBYTE numbers==
 
==Allocating new OSBYTE numbers==
 
Similarly to OSWORD calls, OSBYTE calls <&80 are short OSBYTEs that only
 
Similarly to OSWORD calls, OSBYTE calls <&80 are short OSBYTEs that only

Revision as of 23:05, 12 May 2020

Allocating new OSBYTE numbers

Similarly to OSWORD calls, OSBYTE calls <&80 are short OSBYTEs that only take and return a single parameter in the X register, OSBYTE calls >&7F are long OSBYTEs that take and return two 8-bit parameters or one 16-bit parameter. Unfortunately, all the long OSBYTEs are allocated, so the only remaining ones are short OSBYTEs.

If implementing a operating system interface on another host, then OSBYTEs can be repurposed if they perform the same function. For instance, use OSBYTE &9C (156) to control the serial port in the same manner.

Allocating new OSWORD numbers

Make proposals here for new OSWORD calls. Give a brief outline of what you want your call to do, and an outline parameter block, and also post it to StarDot.

Calls below &80 can only have up to 16 bytes control block. If your call needs more than 16 bytes it must be numbered above &7F.

Calls calls above &7F have a defined layout that specifies the size of the control block up to a maximum of 255 bytes, and a convention has grown up that byte XY+2 and XY+3 hold command and result information.

 XY?0 inward control block size (required)
 XY?1 returned control block size (required)
 XY?2 command
 XY?3 sub-command/returned status
 XY!4 data
 XY!8 data
 etc.

Examples

       OSWORD &B0  OSWORD &BE  OSWORD &BF  OSWORD &C0  OSWORD &C8
XY?0   in          in          in          in          in
XY?1   out         out         out         out         out
XY?2   command     command     command     command     in flags
XY?3   subcommand  flags       result      result      out flags
XY!4   data        address     URI string  socket      SWI
XY!8   data        data                    data        R0
XY!12  etc         etc                     length      R1
etc                                        etc         etc