> I got especially excited when Robert said ".Checking through my copies of QL
> World, I've finally found a description of the TRA command (Aug '87)." and,
> off to the attic I flew. Oh dear.. 11 copies in '87, all but August's!
> (Thank you Robert all the same.)
Just for you, here it what was said (from a section on "Bugging the
ROM"):
"The last new command for the "JS" ROM is TRA. This makes it easier to
custimise QL software for use in other countries. TRA normally has two
parameters. The first points to a table to be used to TRAnslate
characters sent through serial ports and the second is the address of a
new error-message table. Both tables must start with the 'nonsense'
word value 19195, which crops up all over the QL system as an indication
that 'data follows'.
"The next two words in the serial table contains offsets to two
translation lists, measured from the start of the table. The first list
starts with a 256-byte list of substitute codes for each character code
from 0 to 255. When a character is to be transmitted it is looked up in
the table and the code from the appropriate place is transmitted
instead; you can translate the QL end-of-line marker CHR$(10), by
POKEing 13, the usual code for carriage return, into the eleventh byte
of this list.
"Put the value zero into the appropriate slot in the first list if you
want to translate one code into a sequence of several characters. They
appear in the second list, which the QL uses only when transmitting
serial data - there is no time to use it during input.
"The second list starts with a byte value, the number of four byte
entries in that list. Each entry after that starts with the code to be
translated, followed by three replacement codes. If you need only two
replacement characters, the last code in a group should be zero.
[What happens if code not found in 2nd list is not mentioned.
Especially CHR$(0).]
"The message table is simpler. After the 19195 there are 29 words, each
holding the offset from the start of the table to a message. The
messages are stored as normal QL strings - a word length, at an even
address, followed by the appropriate text. Beware - the last two
messages are sequences of three-character day and month names, with no
length word. That is why REPORT 28 goes haywire.
"If either parameter of TRA is zero, the corresponding table is left
alone. TRA 1 selects the standard message table and allows characters
to be transmitted through the serial ports unmolested.
[Note: 'selects' was spelt 'sects', so there may, or may not, be a typo
on the 'TRA 1']
"Turbo Toolkit contains an example program which uses TRA to translate
Sinclair error reports into plain English; other TRA demonstrations have
been printed in the user-group magazines Quanta and Quaser.
Also, as I also mentioned, a later bug report of this appeared in QLW
Jun 88:
"The JS version of the QL introduced a new command, TRA, which
translates or exchanges the codes of characters transmitted through the
serial ports automatically. The bad news, according to top Danish
software house Dansoft, is that TRA translates values only after it has
adjusted the parity of characters, so that character codes greater than
127 may not be translated.
[My thoughts are that all codes may not be translated, or some are that
shouldn't be.]
Cm