Entry | |
---|---|
R0 | Pointer to NUL terminated string to write |
R1 | Pointer to dictionary (0 = RISC OS dictionary) |
R2 | Pointer to NUL terminated special string |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved (but see RO6 note below) |
R2 | Preserved |
The purpose of this call is to write an indirect string, with formatting, to all of the active output streams.
Due to a serious bug in every version of PrettyPrint since RISC OS 2.00, it is important to not end the string with a tab character – tabs must be followed by at least one visible character. Starting with a tab is fine.
Compacted text uses an escape character in the print string to indicate a dictionary entry. It is followed immediately by a byte which is the dictionary entry number. If this byte is in the range 1-255, then the appropriate string in the dictionary is substituted. If it’s 0, then the special string pointed to by R2 is substituted. (This is used in particular by the *Help command.)
The format of a dictionary is a linear list of entries, which can recursively refer to other dictionary entries; each entry is a length byte (counting itself) followed by a 0 terminated string, so an empty string has a length byte of 2. A length byte of zero terminates the dictionary. A length byte of 1 is not allowed.
This call acts like OS_Write0 with several differences:
The RISC OS 6 version of PrettyPrint will return the address of the default dictionary in R1 if R0, R1 and R2 are zero on entry.