User`s manual
H-2
700 '
800 ' *** MAIN PROGRAM ***
900 '
1000 PRINT: FL$="": INPUT"FIELD-LENGTH (FL) = ";FL$
1005 IF FLT<>"" THEN FL=VAL(FL$) ELSE PRINTTAB(20);CHR$(27);FL
1006 IF ABS(FL) > 63 THEN PRINT
"ENTER A VALUE IN THE RANGE <-63,+63>": GOTO 1000
1007 IF FL=0 THEN END
1010 GOSUB 100: PRINT: PRINT TAB(16)"LENGTH ="LEN(IN$)
1020 PRINT TAB(16)"STRING = "CHR$(136)IN$;CHR$(136)
1030 PRINT TAB(16)" VALUE = "VAL(IN$)
1040 GOTO 1000
Storing a USR Routine in a String
This program illustrates a special technique for storing machine language
routines inside strings, instead of POKEing them into high memory. You do
not need to reserve memory via MEMORY SIZE to use this technique.
However,
you must not change the string variable, which
contains the
machine-language code. In other words, don't re-assign another value to this
string (in this program, P$ is used).
For the sake of example, (this user routine accomplishes a "partial scroll":
only the bottom half of the screen is scrolled as you input text, leaving the top
unchanged. Don't input more than two lines without pressing [ENTER].
10 ' EXAMPLE OF A MACHINE LANGUAGE ROUTINE IN A STRING VARIABLE
20 '
50 ' THIS DATA IS THE DECIMAL EQUIVALENT OF THE MACHINE
53 ' LANGUAGE PROGRAM & PERFORMS A HALF-SCROLL OF VIDEO
55 '
60 DATA 33,128,62,17,64,62,1,128,1,237,176,201
70 '
90 CLS: CLEAR 200: DEFINT A-Z
100 CLS: PRINTTAB(15)"HALF-SCROLL PROGRAM": PRINT: PRINT
110 PRINT" NOTE THAT THE UPPER PART OF THE SCREEN WILL NEVER
120 PRINT"CHANGE AS YOU ENTER LINES Or TEXT BELOW. THE BOTTOM OF
130 PRINT"SCREEN WILL SCROLL INDEPENDENTLY OF THE TOP OF THE SCREEN
140 PRINT"WHEN IT IS FULL.
150 PRINT@512,STRING$(64,176);: N=0
151 '
152 ' *** READ MACHINE LANGUAGE PROGRAM INTO P$ ***
153 '
155 P$="": FOR I=1 TO 12: READ J: P$=P$+CHR$(J): NEXT










