Errata and Addenda

See all articles from Update July 1991

Bob Hartung, [address omitted]

USING LOOPS IN QL DO FILES

Thanks to Peter Hale for pointing out to me that I should clarify and expand on the comments I made on using loops in DO files (p. 28, April UPDATE). Only a simple FOR loop is given as an example in section 6.1 of the TKT2 manual. Both the simple and the FOR/NEXT type of loop, as well as the REPeat loop, will work as one-line multi-statements in a DO file, as they do in a direct-command multi-statement or in a numbered program listing. However, neither the END FOR nor the END REPeat will work if placed in a separate line-statement from the one used to initialize the respective loops.

MOVING TS2068 CODE BLOCKS

For anyone not familiar with the procedure for relocating blocks of code from one TS2068 address to another, my references in the April UPDATE, p.16, and in the January issue, p. 31, to installing code for printer drivers may also need some clarification. If stored in a first-line or last-line REM, relocatable machine code for a printer driver or other routine may be merged with a program listing rather than being loaded separately.

Using Tom Woods‘ 117-byte printer driver from his ProFile 2068 as an example, first load in the program, then make a save of just this block of code by using SAVE “filename”CODE 63672,117. The original beginning address for the block is 63672, and 117 is the number of bytes in the block.

Before the move can be made to the REM statement, the statement must first be padded out to the required number of bytes by typing in 1234567890…etc. to exactly 117 bytes for a first-line REM or 121 bytes for a last-line REM. Once this is done, the saved code block is transferred by the command LOAD “filename”CODE m,117. If moving the block to a first-line REM, then use PEEK 23635+PEEK 23636*256+5 for m. For a last-line REM containing 121 bytes use PEEK 23627+PEEK 23628*256-121 for m.

If desired, a first-line REM may be renumbered as line 0 by POKE 26711,0. To tell the system pointers where to find the start of the printer routine in a first-line REM, include on another line in the listing POKE 26703,PEEK 23635+5: POKE 26704,PEEK 23636. For a last-line REM use LET loc=PEEK 23627+PEEK 23628*256-121: LET msb=INT(loc/256): LET lsb=loc-msb*256: POKE 26703,lsb: POKE 26704,msb. If a save is made of just the REM definition and the system variable POKEs it may then be merged with a program listing as desired or else used alone as driver routine.

Note that because the Profile 2068 driver uses address locations 63672-4 to store variable data there may be a conflict if any other code routine in your program uses these same addresses. One way around this would be to POKE these three addresses back to their original values immediately after any use of LPRINT.