Screen$ – TS1000

Author(s): Cem Barut
Publication: LISTing Newsletter
Date: May - June 1985
Pages: 20

Is that TS1000 gathering dust in the closet? Drag it out and type in this short routine, I guarantee it will perk you right up.

It is a short MC routine I wrote to emulate the 2068 screen$ command. It saves a complete display file in a string of your choice, ready to recall with a simple print string command from basic. Just observe these few rules for it’s use:1. Dim your string(s) as the first program lines e.g. Dim A$(704) 2. Poke the code of your string letter into 16417. You can find the code of the letter by entering a print code “_” in the immediate mode. 3. Call the screen$ routine to store from within your basic program and before any full screen error reports appear (error 5). Please note that the command can not be used from the immediate mode.

I have used the program to print menus for utility programs as well as covers for game programs. The advantages of screen$ are the relatively fast rate of retrieval, the potential to store 20 or more screens in 16K, and the ability to design a screen with a drawing utility program and save it.

First create a rem statement with 49 or more spaces. Then enter lines 10 through 200 of listing 1. Enter the code from left to right. When you are done and the sumcheck is verified to be 4680, delete lines 10 through 200.

An example program is given in listing two.

CEM BARUT

LISTING 1

   1 REM 12345678901234567890123456789012345678901234567890
10 FOR I=16514 TO 16562
20 INPUT A
30 POKE I,A
40 SCROLL
50 PRINT I;":";A
60 NEXT I
65 SCROLL
70 PRINT "DONE"
75 SCROLL
100 REM SUMCHECK SHOULD BE *4680*
120 PRINT "PRESS A KEY BEGIN SUMCHECK"
130 IF INKEY$="" THEN GOTO 130
140 FAST
150 LET SUM=0
160 FOR I=16514 TO 16562
165 LET Z=PEEK I
170 LET SUM=SUM+Z
180 NEXT I
190 SLOW
200 PRINT SUM
58    33    64    198   160   42
20    64    237   91    16    64
237   82    68    77    42    16
64    237   177   1     5     0
237   74    235   42    12    64
35    6     22    197   6     32
78    235   113   235   35    19
16    248   35    193   16    241
201
ADDR HEXCODE   NAME MNEMONIC
=========================
4082 3A2140         LD A,(4021)
4085 C6A0           ADD A,A0
4087 2A1440         LD HL,(4014)
408A ED5B1040       LD DE,(4010)
408E ED52           SBC HL,DE
4090 44             LD B,H
4091 4D             LD C,L
4092 2A1040         LD HL,(4010)
4095 EDB1           CPIR
4097 010500         LD BC,0005
409A ED4A           ADC HL,BC
409C EB             EX DE,HL
409D 2A0C40         LD HL,(400C)
40A0 23             INC HL
40A1 0616           LD B,16
40A3 C5             PUSH BC
40A4 0620           LD B,20
40A6 4E             LD C,(HL)
40A7 EB             EX DE,HL
40A8 71             LD (HL),C
40A9 EB             EX DE,HL
40AA 23             INC HL
40AB 13             INC DE
40AC 10F8           DJNZ 40A6
40AE 23             INC HL
40AF C1             POP BC
40B0 10F1           DJNZ 40A3
40B2 C9             RET

LISTING 2

   1 REM U5RNDLEN %4E=RND GOSUB ?(RND GOSUB ???E(RND GOSUB %L\' \:  GOSUB ? FOR E£RND7\.'-VAL \.'4? FOR ? FOR 7<( SAVE 7AT ( LET TAN 0
10 DIM A$(704)
20 POKE 16417,38
30 FOR I=1 TO 100
40 PRINT "X";
50 NEXT I
60 RAND USR 16514
70 CLS
80 PRINT A$

Transcription note: The two dark cells in line 1 are typed %4 and %L, meaning an inverse-video 4 and L. The scan cannot show them, so they are worked out from the printed DATA.

Listing 2 as printed (machine code REM line)
Listing 2 as printed (machine code REM line)

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.