Short program to demonstrate the use of LDIR to move the contents of the 2068 display file to another location in memory and back.
Content
Image Gallery
Source Code
1 CLEAR 29999
\n10 PRINT "0 - Load SCRN display file"'"1 - Full-screen store"'"2 - Top screen store"'"3 - Middle screen store"'"4 - Bottom screen store"
\n20 PAUSE 0: LET k$=INKEY$: IF k$="" THEN GO TO 20
\n30 IF k$="0" THEN CLS : LOAD "SCRN" CODE : PRINT "Any key to continue": PAUSE 0: RUN
\n40 IF k$="1" THEN LET STP=16384: LET INS=INT (STP/256) : LET NOB=6192: LET INB=INT (NOB/256): GO TO 80
\n50 IF k$="2" THEN LET STP=16384: LET INS=INT (STP/256): LET NOB=204S: LET INB=INT (NOB/256): GO TO 80
\n60 IF k$="3" THEN LET STP=163S4+2048: LET INS=INT (STP/256): LET NOB=2048: LET INB=INT (NOB/256) : GO TO 80
\n70 IF k$="4" THEN LET STP=16384+4096: LET INS=INT (STP/256): LET NOB=2096: LET INB=INT (NOB/256)
\n80 CLS : REM Create screen-fill
\n90 FOR n=1 TO 704: PRINT "\`.";:NEXT n
\n100 FOR n=0 TO 21: PRINT AT n,0;n: NEXT n
\n110 REM Defines selected lines/cols and copies from DFILEl to RAM
\n120 POKE 65356,1: REM LD BC,no. of bytes to move
\n130 POKE 65357,NOB-(256*INB) : REM n LSB
\n140 POKE 65358,INB: REM n MSB
\n150 POKE 65359,17: REM LD DE,destination address 30000
\n160 POKE 65360,48: REM n LSB
\n170 POKE 65361,117: REM n MSB
\n180 POKE 65362,33: REM LD HL,source address
\n190 POKE 65363,STP-(256*INS) : REM n LSB
\n200 POKE 65364, INS: REM n MSB
\n210 POKE 65365,237: REM ED prefix
\n220 POKE 65366,176: REM LDIR block-move
\n230 POKE 65367,201: REM RETurn
\n240 RANDOMIZE USR 65356: REM Call block-move routine
\n250 PRINT #0;AT 1,0; "Any key to continue": PAUSE 0
\n260 REM Moves RAM data to DFILE1
\n270 CLS
\n280 POKE 65357, NOB-(INB*256) : REM LSB no. bytes
\n290 POKE 65358, INB: REM MSB nobytes
\n300 POKE 65360,STP-(256*INS) : REM LSB dest
\n310 POKE 65361, INS: REM MSB dest
\n320 POKE 65363,48: REM LSB source in RAM (30000)
\n330 POKE 65364,117: REM MSB sou rce in RAM (30000)
\n340 RANDOMIZE USR 65356
\n350 PRINT #0;"Key 5 to save or m for menu"
\n360 PAUSE 0: IF INKEY*="5" THEN PRINT #0;AT 0,0,,,,: GO TO 9998
\n370 RUN
\n9997 SAVE "SCRNmove" LINE 1: STOP
\n9998 SAVE "SCRN "CODE STP,NOB
\n9999 RUN