h6. [[OS SWI Calls]] h6(. » OS_SWINumberToString h2. OS_SWINumberToString h5. (SWI &38) |_<^{width:4em}. Entry | | |<^. R0 |<^. SWI number | |<^. R1 |<^. Pointer to buffer| |<^. R2 |<^. Buffer length | |_<^{width:4em}. Exit | | |<^. R0 |<^. Preserved | |<^. R1 |<^. Preserved | |<^. R2 |<^. Length of string in buffer including terminator | h4. Use The purpose of this call is to convert a SWI number to a string containing its SWI name. h4. Notes The returned string is null-terminated, and starts with an X if the SWI number has bit 17 set. SWI numbers < &200 have an 'OS_' prefix to the main part, and a SWI-dependent end section (which is 'Undefined' for unknown OS SWIs). SWI numbers in the range &100 to &1FF are converted in the form OS_WriteI+"A", or OS_WriteI+23 if the character is not a printable one. SWI numbers >= &200 are looked for in modules. If a suitable name is found, it is given in the form <code>module_name</code> or <code>module_number</code>, eg. Wimp_Initialise, Wimp_32. If no name is found in the modules, the string 'User' is returned. The PRM incorrectly states that this SWI returns the length of the string; it actually returns the length of the string and the terminator. h4. See also * [[OS_SWINumberFromString]]