Classic Computer Magazine Archive COMPUTE! ISSUE 17 / OCTOBER 1981 / PAGE 22

Basically Useful BASIC

Automatic DATA Statements For CBM And Atari

Dr. Harald Linder
Krefeld, West Germany

The following BASIC program converts a program from machine language into BASIC DATA statements by means of the "dynamic keyboard." For the Original PETs, the numbers 623,624,158 in the last line, must be replaced by 527,528,525.

1 INPUT "START ADDRESS" A : INPUT "END AD~~DRESS" ; E : Z = 2000
2 PRINT "{CLEAR} {2 DOWN}"Z "DATA"; : IFA > E~~THENEND
3 FOR A = A TO A + 15 +(E < A + 15) * (A + 15-E)
4 PRINTMID$ (STR $ (PEEK(A)), 2) ","; : NEXT~
5 PRINT "{LEFT} ": PRINT " A = " A " : E = " E rldquo; : Z = ~ ~ " Z + 10 " : GOTO2 {HOME} ";
6 POKE623, 13 : POKE624, 13 : POKE158, 2: END~

Program 1. CBM Version

0 BEG = 7 * 4096 : FIN = BEG + 759 : ? "{CLEAR 2 DOWN}"
1 FOR I = BEG TO FIN STEP 6
2 ? I; " DATA ";
3 FOR J = I TO I + 5
4 ? PEEK (J); ",";
5 NEXT J : ? CHR $ (126)
6 NL = NL + 1 : NL < 15 THEN 9
7 ? "CONT" : POSITION 2, 0 : POKE 842, 13 : STOP
8 POKE 842, 12 : NL = 0 : ? "{CLEAR 3 DOWN} "
9 NEXT I :? "CONT"
10 POSITION 2, 0: POKE 842, 13 : STOP
11 POKE 842, 12 : = NL = 0 : = ? "{CLEAR 2 DOWN} "
12 FOR I = 0 TO 12:? I : NEXT I := ? "POKE 842, 12 " : GOTO 10

Program 2: Atari Version