Using the operating system. The Psion organiser has many features built into its ROM, and some of these can be called from machine code using the SWI instruction. The SWI instruction is followed by a byte indicating which of the system services you want. The SWI instruction calls a routine in the ROM which performs the task required, and after that has finished the program execution continues at the instruction which follows immediately after the service byte. Most services need some parameters.
Information is passed back from the system services in the same way.
Some services can not always perform their tasks, and an error can be returned. A service shows an error has occurred by returning with the carry flag set, and with B containing the error code. Some services that can never return an error may not always clear the carry flag, so the carry flag should only be tested after services that can cause errors. You can freely use these addresses yourself as long as you keep in mind that the information stored there is lost by calling the operating system. Note that strings are usually leading byte-count strings, which will from now on be abbreviated by 'lbc string'.