Automating the Data Line

Publication

Pub Details

Date

Pages

See all articles from CATS v6 n1

Some programs in Basic call in M/C routines for repetitive or special functions. In such cases it is often convenient to create a joint record.

The Basic program can include a decimal loader, as shown in lines 9955 to 9975, below. The details of the M/C routine are contained in the Data lines.

This permits all the details to be stored in the Basic program, on tape or on paper, without treating the code portion separately.

In writing such a Basic program, the data lines may be formed automatically. After the M/C portion has been developed and put in memory with an assembler or the like, the DATA LINE program is run. The desired data line number is specified, along with the limits in memory of the M/C bytes, and the numbers are recorded automatically.

The data may be spread over several program lines by just running DATA LINE several times for consecutive portions of memory.

This approach may be used for any type of program line or instruction. Just have the desired instruction built up in string R$, like you would enter it from the keyboard, and then RANDOMIZE USR 65300.

The M/C program is not location-sensitive, so it may be stored any place in memory. Also the string need not be R$, for any letter may be used; however, then the last number in line 9965 must be changed to the code for the upper-case version of that letter; 82 is the code for R.

Products

 

Media

 

Image Gallery

Source Code

 9900 REM ******** DATA LINE
 9905 IF PEEK 65300<>33 OR PEEK 65341<>201 THEN GO SUB 9955
 9910 INPUT "DATA LINE";LL
 9515 INPUT "M/C START";SS
 9920 INPUT "M/C END";EE
 9925 LET R$=STR$ LL+CHR$ 228
 9930 FOR N=55 TO EE
 9935 LET R$=R$+STR$ PEEK N+","
 9940 NEXT N: LET R$(LEN R$)=" "
 9945 RANDOMIZE USR 65300
 9950 STOP
 9955 RESTORE 9965
 9960 FOR FOR N=65300 TO 65341: READ R: POKE N,R: NEXT N: RETURN
 9965 DATA 33,19,0,9,229,229,42,97,92,43,43,205,99,19,14,82
 9970 DATA 205,187,44,35,78,35,70,35,229,197,42,89,92,229
 9975 DATA 205,187,18,209,193,225,237,176,205,58,14,201
 9980 STOP
Scroll to Top