User guide

__swi (0) char __ReadCharacter (unsigned op);
__swi (0) void __WriteCharacter (unsigned op, char c);
These can be used in a more reader-friendly fashion by defining the following:
#define ReadCharacter () __ReadCharacter (0);
#define WriteCharacter (c) __WriteCharacter (1, c);
However, if you use r0 in this way, only three registers are available for passing parameters to the SWI. Usually, if
you need to pass more parameters to a subroutine in addition to r0-r3, you can do this using the stack. However,
stacked parameters are not easily accessible to a SWI handler, because they typically exist on the User mode stack
rather than the supervisor stack employed by the SWI handler.
Alternatively, one of the registers (typically r1) can be used to point to a block of memory storing the other
parameters.
Handling Processor Exceptions
Copyright ?1999 2001 ARM Limited 5-13