Screen Store Program for TS2068

Publication

Pub Details

Date

Pages

Screen Store Program for TS2068

Here’s a piece of a program that may interest some of your readers. It’s designed to store the screen contents of the TS 2068.

The cute thing about the program is that it stores the machine code routine and the data together in one string (A$). With this approach you don’t have to mess around with RAMTOP, or separate M/C SAVEs. What you do have to be careful about is that you DIMension A$ the first thing, and that you do not reDIMension it. It’s OK to change the contents of the string—in fact, that’s what the program does. But the location of the string, which is established when it is DIMensioned, must remain as unmoved as the tree that’s standing by the water.

Of course, you must not monkey around with the first 31 bytes of it, either.

This program should be SAVEd as: SAVE "program" LINE 9910.

BASIC Listing

9900 DATA 197,225,1,35,0,9,235
9901 DATA 33,0,64,1,0,27,237,176,201
9902 DATA 197,225,1,19,0,9,1,0,27
9903 DATA 17,0,64,237,176,201
9910 CLEAR : DIM A$(6950)
9915 RESTORE
9920 FOR F=1 TO 31
9925 READ A
9930 LET A$(F)=CHR$ A
9935 NEXT F
9940 LET store=9960: LET recall=9980
9959 STOP
9960 REM Store
9970 RANDOMIZE USR (PEEK 23627+256*PEEK 23628+6): RETURN
9980 REM Recall
9990 RANDOMIZE USR (PEEK 23627+256*PEEK 23628+22): RETURN

Machine Code Listing

; ---------------------------------------------------------------------------
; Screen Store Program for TS2068 --- Basil Wentworth
; Relocatable: the routine is copied into a BASIC string, A$, and computes
; its own run-time address from A$'s location. Offsets below are relative
; to byte 1 of A$ (= offset 0). Store begins at offset $00; Recall at $10.
; ---------------------------------------------------------------------------

        ORG     0

STORE:  PUSH    BC                      ; BC holds the USR number
        POP     HL                      ; HL now holds it
        LD      BC,35
        ADD     HL,BC                   ; HL holds the address of A$(35)
        EX      DE,HL                   ; DE now holds it [1]
        LD      HL,16384                ; address of screen data
        LD      BC,6912                 ; number of bytes of screen data
        LDIR                            ; copy (HL) to (DE), BC bytes
        RET

RECALL: PUSH    BC                      ; BC holds the USR number
        POP     HL                      ; HL now holds it
        LD      BC,19
        ADD     HL,BC                   ; HL holds the address of A$(19) [2]
        LD      BC,6912
        LD      DE,16384                ; as above
        LDIR
        RET

Products

 

Media

 

Image Gallery

Source Code

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

Scroll to Top