Automatic Data Statements

Started by Blacklord, August 08, 2009, 08:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blacklord

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.

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