The program given in the April 89 issue titled “TS-2068 INPUT” has a machine code program “Concatm.C1” (By Don Lamen) which provides fast input typing and concatenation of the input data to a typing buffer. That program works just fine, but we used the TS-2040 Print Buffer area for storing the code program. I ask Don to provide the code for a new storage place in memory starting at Address 24311. Following is the Z80 assembly instruction program for the new “concat.C1” code program. Then a BASIC program is given to POKE the Code to memory and then SAVE it to your disk. This LOADER/SAVER program can be used for universal purpose to install any code program to memory and check-sum the program. When you run it, INPUT 24311 for starting address and 202 for Byte length. Then for the SAVE, input “concat.C1” as the title to save to disk.
Next, to operate the “TS-2068 DATA INPUT” program as given in the April 89 issue, with this newly located code, change Line number 150, 167, 265, and 390 to “RANDOMIZE USR 24355”. Also change line number 158 PEEKS to <LET a=PEEK 24314> <LET b=PEEK 24313> <LET a1=PEEK 24311+256*PEEK 24312>. Then the “TS-2068 DATA INPUT” program will run with this new Code Location. (After it is saved by the “LOADER PROGRAM LISTING” given herein).
This new location of the Concat.C1″ code program opens up the Printer Buffer area for its normal use, and for use of the Oliger CPI printer code. Also the new location does not cost any FREE memory, and is safe from being overwritten by an operating program.
The LOADER PROGRAM LISTING assumes that the user has initialized the DOS before using RUN to operate the loader. Also line number 250 is set up for a LKDOS SAVE of the concat.C1 Code file. If using another DOS replace the RANDOMIZE USR 100 and SAVE with the proper syntax for the DOS. Once the LOADER program is keyed in it is ready to operate with <RUN>. It first pokes the code to the memory addresses, then checks the sum. If the sum is as given in line 2022 (and input at the prompt), the LOADER program proceeds to the Disk SAVE line at line 250 and SAVES the code program to disk. You should input “concat.C1” as the title for SAVE and input 24311 as the starting address and 202 as the byte length.
Before the code SAVES to Disk, Line number 230 peeks the code back from memory and checks the SUM to make sure that the DATA lines have been keyed in correctly. If not you get the long toot and will have to re-check your work. I would suggest that you use a different diskette than the one that has the original concat.C1 program. Then transfer the original “DATA INPUT” Basic program to this new disk. This way you will have two DATA INPUT programs, one working with the old code and one working with the new. We are spending this extra space in Update because the DATA INPUT program given in the April issue and amended here is the best “Front End” for a Data Base program that has ever been given for the TS-2068. Everyone should have it.
Dear Bill,
Here is the update on the “concat” code.
The new entry points are:
Variable 1. 24311 (2 bytes) --- LEN u$ ( BASIC VAR A1 ) Variable 2. 24314 (1 byte ) --- LIN ( BASIC VAR A ) Variable 3. 24313 (1 byte ) --- COL ( BASIC VAR B ) Variable 4. 24315 (1 byte ) --- CHAR. ( BASIC VAR C ) Entry point 1. Print the last 148 characters. Entry point 2. Concatenate
I have added six new bytes from 5F03h to 5F08h to prevent a crash in the event of a missing u$. If there is no u$ a ” 2/n Variable not found ” error report will be printed.
Code Disassembly
24311 5EF7 0000 VAR-1: LEN u$ ; (A1)
24313 5EF9 0000 VAR-2: SPOSN ; COL (B) / LIN (A)
24315 5EFB 00 VAR-3: CHAR. ; (C)
5 bytes
24316 5EFC 2A4B5C FIND-u$: LD HL, (VARS)
7E CHECK: LD A, (HL)
FE55 CP 55 ; Is it u$
C8 RET Z ; If yes return
5F03 FE80 CP 80 ; End of VARS ?
2002 JR NZ, NEXT-ONE ; NO It's OK
CF01 RST 08 DEFB:'2' ; Not found
CD2017 NEXT-ONE: CALL 1720, NEXT-ONE
EB EX DE, HL
18F0 JR CHECK
19 bytes
24335 5F0F CDA608 CLS: CALL 08A6, CLS
010000 LD BC, 0000
6 bytes
24341 5F15 213B5C PRINT-AT: LD HL, 5C3B, FLAGS
CB8E RES 1, (HL)
213C5C LD HL, 5C3C, TV-FLAG
CB86 RES 0, (HL)
CDB205 CALL 05B2, PRINT-AT
C9 RET
14 bytes
Entry point 1: (PRINT LAST 148 CHARS.)
24355 5F23 CD0F5F PRINT-148: CALL 5F0F, CLS
CDFC5E CALL 5EFC, FIND-u$
23 INC HL
4E LD C, (HL)
23 INC HL
46 LD B, (HL)
ED43F75E LD (VAR-1), BC ; LEN u$
23 INC HL
EB EX DE, HL
219400 LD HL, 0094 ; 148 dec.
A7 AND A ; Reset cy
ED42 SBC HL, BC
09 ADD HL, BC
3008 JR NC, PRINT$ ; If LEN u$
EB EX DE, HL ; <= 148 then
09 ADD HL, BC ; print u$.
A7 AND A ; If LEN U$
ED52 SBC HL, DE ; > 148 then
EB EX DE, HL ; print last
44 LD B, H ; 148 chars.
4D LD C, L
24388 5F44 CDDB21 PRINT$: CALL 21DB, PR-STRING
ED4B885C LD BC, (SPOSN)
3E18 LD A, 18 ; 24 dec.
90 SUB B
47 LD B, A
3E21 LD A, 21 ; 33 dec.
91 SUB C
4F LD C, A
FE20 CP 20 ; New line ?
2003 JR NZ, STORE
0E00 LD C, 00
04 INC B
24410 5F5A ED43F95E STORE: LD (VAR-2), BC ; Store param.
CD155F CALL 5F15, PR-AT
3E5F LD A, 5F ; Cursor
D7 RST 10 ; Print cursor
65 bytes
Entry point 2: (CONCATENATE)
24420 5F64 3A3B5C CONCAT: LD A, (FLAGS)
FEDD CP DD ; 221 dec.
38F9 JR C, CONCAT ; Wait for key
3A085C LD A, (LAST-K)
5F LD E, A ; Save char. in E.
3EDC LD A, DC ; 220 dec.
323B5C LD (FLAGS), A
7B LD A, E
FE20 CP20 ; Is it < 32 ?
300A JR NC, CONT ; No It's OK.
219E00 LD HL,009E ; If < 32 dec. then
; go to line 158 in
; BASIC.
24444 5F70 CDD616 CALL 16D6, LINE-ADDR.
22555C LD (NXTLIN), HL
C9 RET
24451 5F83 32FB5E CONT: LD (VAR-3), A ; Save char.
CDFC5E CALL 5EFC, FIND-u$
23 INC HL
4E LD C, (HL)
34 INC (HL)
23 INC HL
46 LD B, (HL)
2001 JR NZ, ADVAN
34 INC (HL)
09 ADVAN: ADD HL, BC ; HL-> to last
CDB812 CALL 12B8, ONE-SPACE ; char.
24469 5F95 3AFB5E LD A, (VAR-3) ; Get char.
23 INC HL
23 INC HL
77 LD (HL), A ; Add it to u$
24475 5F9B ED4BF95E PR-2: LD BC, (VAR-2)
CD155F CALL 5F15, PR-AT
3AFB5E LD A, (VAR-3) ; Get char.
D7 RST 10 ; Print it
3E5F LD A, 5F ; Cursor
D7 RST 10 ; Print cursor
24489 5FA9 2AF95E LD HL, (VAR-2)
2C INC L
7D LD A, L
FE20 CP 20 ; Is it 32 dec
2003 JR NZ, UPDATE
2E00 LD L, 00
24 INC H
24501 5FB5 22F95E UPDATE: LD (VAR-2), HL ; 'AT' Param.
2AF75E LD HL, (VAR-1) ; LEN u$
23 INC HL
22F75E LD (VAR-1), HL
18A3 JR CONCAT
93 bytes
24513 5FC1 NEXT BYTE TOTAL 202 bytes
I expect to have the machine code routines for Database-1 ready in time for the October issue of UPDATE.
For Better Computing,
Don Lamen
SINCUS
200 REM *** LOADER PROGRAM LISTING **
210 CLS : INPUT "Input Check Sum of Program";ck: INPUT "Input Start Addres to SAVE Code ";x1: INPUT "Input Byte Length:";x2
220 RESTORE 2000: LET x=0: FOR n=x1 TO x1+x2-1: READ a: LET x=x+a:: POKE n,a: REM *Poker*
225 NEXT n
230 LET b=0: FOR n=x1 TO x1+x2-1: LET b=b+PEEK n: REM * Get Actual Sum *
232 NEXT n
234 IF b=ck THEN GO TO 250
240 BEEP 2,6: PRINT "ERROR! Recheck work.": STOP
250 CLS : INPUT "Key In a Code Name To SAVE. Include Extension-";a$: INPUT "Input Starting Address for SAVE ";x: RANDOMIZE USR 100: SAVE a$CODE x,x2
260 CLS : PRINT AT 10,0;"The code program has been SAVED at address ";x: STOP
2000 DATA 0,0,0,0,0,42,75,92,126,254,85,200,254,128,32,2,207,1,205,32
2002 DATA 23,235,24,240,205,166,8,1,0,0,33,59,92,203,142,33,60,92,203,134
2004 DATA 205,178,5,201,205,15,95,205,252,94,35,78,35,70,237,67,247,94,35,235
2006 DATA 33,148,0,167,237,66,9,48,8,235,9,167,237,82,235,68,77,205,219,33
2008 DATA 237,75,136,92,62,24,144,71,62,33,145,79,254,32,32,3,14,0,4,237
2010 DATA 67,249,94,205,21,95,62,95,215,58,59,92,254,221,56,249,58,8,92,95
2012 DATA 62,220,50,59,92,123,254,32,48,10,33,158,0,205,214,22,34,85,92,201
2014 DATA 50,251,94,205,252,94,35,78,52,35,70,32,1,52,9,205,184,18,58,251
2016 DATA 94,35,35,119,237,75,249,94,205,21,95,58,251,94,215,62,95,215,42,249
2018 DATA 94,44,125,254,32,32,3,46,0,36,34,249,94,42,247,94,35,34,247,94
2020 DATA 24,163,0
2022 REM Check sum=21223
This Loader Program Listing was created in its entirety, including the DATA lines, by the “Miz.B4” program, given on page 4.
Sinc Link
During this uncertain time about Sinclair Publications the Ontario TSUG is rising to the occasion by increasing the size and content of SINC LINK, their magazine size newsletter. The MAY-JUNE 89 issue is 24 pages and is chuck full of detail. Subscription is $12.00 (U.S). Enclose US Cash bills or Intl. Money order. (US checks costs for processing).
Sinc Link, 14 Richome Court, Scarborough, Ontario M1K 2Y1.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.