Commodore 128 Programmer's Reference Manual page 104

Hide thumbs Also See for 128:
Table of Contents

Advertisement

94
COMMODORE 128
U
2 COLOR 4,1:COLOR 0,1:COLOR 5,1
5 A$="PICTURE"
10
SCNCLR:PRINT:PRINT:PRINT:PRINT"LOAD"CHR$(34)A$CHR$(34)",8,1"
15 PRINT:PRINT:PRINT"NEW"
]
25 B$="FILE3.BIN"
I
30 PRINT:PRINT:PRINT"LOAD"CHR$(34)B$CHR$(34)",8,1"
U
45
PRINT:PRINT:PRINT:PRINT:PRINT:PRINT"SYS12*256"
90
PRINT CHR$(5):PRINT"
GREETINGS FROM COMMODORE"
100 PRINT"
PLEASE STAND BY - LOADING":PRINT CHR$(144)
\
>
200 PRINT CHR$(19)
! )
300 POKE208,7:FORI=842TO851:POKEI,13:NEXT
Lj
Program 3-3. Loading Routine
\
(
Line 2 colors the border, screen and characters black. Line 5 assigns A$ the
filename "PICTURE", which in this example assumes that it is an 8K binary file of a
| /
bit-mapped screen. Line 10 places the LOAD instruction for the picture file on the
L-J
screen, but does not execute it. A carriage return from the keyboard buffer executes the
load instruction once the program ends and the keyboard buffer empties. Line 15 prints
j J
the word "NEW" on the screen. Again, this operation is not carried out until a carriage
[j
return is executed on the same line once the keyboard buffer empties. After loading a
machine language program, a NEW is performed to set pointers to their original
r~)
positions and clear the variable storage area. Line 30 displays the second load instruc-
IJ
tion for the machine language program "FILE3.BIN". This hypothetical program
enables the bit mapped PICTURE, and anything else you want to supply in the program.
Line 45 initiates (SYS12*256), the "FILE3.BIN" program starting at 3072 ($0C00)
j
once the keyboard buffer empties. This is only a template sample for you to follow.
^
"PICTURE" and "FILE3.BIN" are programs you supply and are only used to illustrate
one technique of automatic loading. Since the previous character color was black, all the
} i
loading instructions are displayed in black on a black background, so they can't be seen.
U
The CHR$(5) in line 90 changes the character color to white, so the only visible
messages are the ones in white in lines 90 and 100, while the disk drive is loading
} I
"PICTURE" and "FILE3.BIN". Line 300 is the buffer routine.
\J
If you were to do each step manually it would require seven "RETURNS". This
program places seven carriage return characters in the keyboard buffer, and they are
^
dispensed automatically when the program ends. As each RETURN is accepted, the
[
corresponding screen instruction is enacted automatically as if you had pressed the
RETURN key manually.
PROGRAMMING THE
-
CI28 FUNCTION KEYS
As each of the function keys (Fl through F8) is pressed, the computer displays a BASIC
°
command on the screen and in some cases acts immediately. These are known as the
default values of the function keys. Enter a KEY command to get a list of function key
j I
values at any time.
U

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents