                            BASICTrans
                            ==========

BASIC will be internationalised by way of a set of new SWIs based at &42C80.
Memory for the translation aspect can be allocated from the RMA if required and
code can be shared between BASIC and BASIC64 (because it ends up inside the
SWI).

[aside: memory inside the SWI call is invulnerable to the task swapping problem
found when BASIC itself attempts to use RMA memory. If two BASIC programs are
being "task manager" swapped between, the swaps do not occur when in SWI mode.]

Functions of the code:

(1) &42C80 "BASICTrans_HELP"

Interpret, translate if required, and print HELP messages:

In:

R0: pointer to lexically analysed HELP text (terminated by 0d)
R1: points to program's name (BASIC or BASIC64)
R2: points to the lexical analyser's tables

Out:

R0: xxx
R1: xxx or 0
R2: xxx

V set if not done or SWI non-existent. If R1 is not zero, then BASIC will
print its own (short) Help text (it is non-zero on entry!).

[In order to share the entirety of the HELP text between BASIC and BASIC64,
this call can be implemented for English and both BASIC and BASIC64 assembled
without their own HELP text. About 15KBytes can be shared like this.]

(2) &42C81 "BASICTrans_Error"

Copy translated error string to buffer

In:

R0: unique error number (0..112 presently)
R1: buffer in which to place the error
    (format: string followed by 0)

Out:

R0: xxx
R1: xxx
R2: xxx
R3: xxx

V set if not done or SWI non-existent.

[In order to share the entirety of the error string text between BASIC and
BASIC64, this call can be implemented for English and both BASIC and BASIC64
assembled without their error messages. About 6KBytes can be shared like this.
Correct error numbers are vital to the functioning of the interpreter and so
are held in BASIC or BASIC64]

(3) &42C82 "BASICTrans_Message"

Translate and print miscellaneous message

In:

R0: unique message number (0..25 presently)
R1: message dependent value
R2: message dependent value
R3: message dependent value

Out:

R0: xxx
R1: xxx

V set if not done or SWI non-existent.

The classic problem of the error handler's " at line " can now be handled as
follows:

TRACE OFF
IF QUIT=TRUE THEN
 ERROR EXT,ERR,REPORT$
ELSE
 RESTORE:!(HIMEM-4)=@%
 SYS"BASICTrans_Message",42,ERL,REPORT$ TO ;@%
 IF (@% AND 1)<>0 THEN
  REPORT:@%=&900:IF ERL<>0 THEN PRINT" at line "ERL ELSE PRINT
 ENDIF
@%=!(HIMEM-4)
ENDIF
END

This allows the BASICTrans_Message code to print the string and optional " at
line "ERL information in any order it likes.

[There are not many "miscellaneous" messages, so no great saving is to be had
in providing RISC OS 2.50 with a shared implementation]
