Sample Module  -  Relocatable module example

by Alan Wrigley

This item complements the article Creating Relocatable Modules on page 46 of this month's RISC User magazine, which describes how to implement your own SWI calls using a module. On the disc is a sample module called SlaveMod which implements a set of SWI calls that merely display a message on the screen; this module is described and listed in the magazine.

Running the item from the RISC User menu system opens a directory viewer containing the module together with its source code program. By studying the source code in conjunction with the accompanying article (as well as Part 1 last month), you will get a clearer idea of how modules are constructed and how to implement SWI calls.

SlaveMod is installed by double-clicking on the SlaveRM icon in a directory viewer. Once the module is installed, it responds to four SWI calls. These are:
  Slave_MakeTea
  Slave_WashUp
  Slave_HooverLivingRoom
  Slave_FeedCat
Issuing one of these calls (for example by using the Basic SYS command at the Basic prompt) will produce an appropiate message.

The disc also contains a more complex module, StringMod. This is described elsewhere.

Copyright  Alan Wrigley 1995
