Dick Smith VZ200 Technical Reference Manual page 14

Personal colour computer
Table of Contents

Advertisement

Method 1: This method of reserving space for a machine code
program involves shifting the BASIC program area upward in
memory from its normal start at 7AE9, creating a space
immediately above the communications region. The machine code
program can then be loaded into this space, probably by POKEing
it from your main BASIC program.
Needless to say, the BASIC program area can only be shifted up
before your main program is loaded into it (if it were done
afterwards, the start of the program would be lost). But the
shifting is quite easy to do, because all that is required is
(a) to change the 'Start of BASIC program' and 'End of
Program/Start of VLT' pointers, together with (b) creation of a
new 'null program' at the start of the new program area.
This can be done quite easily by a small BASIC program which is
fed into the computer ahead of your main program. Here is what
it looks like if you want to reserve say 128 bytes:
10 POKE 31593,0:POKE 31594,0:POKE31595,0
20 POKE 30884,105:POKE 30885,123
30 POKE 30969,107:POKE 30970,123
Here line 10 pokes a 'null program' of 3 zero bytes into the
start of the new program area (which starts at 7B69H, or 31593).
Line 20 pokes the decimal equivalents of the low and high bytes
of this new starting address of the program area into its
pointer address, while line 30 pokes in the corresponding values
for the new EOP/VLT pointer.
Note that this shifting program 'self destructs' -- once you run
it, the BASIC interpreter loses all knowledge of its existence
in memory. So if you then try to LIST or RUN, nothing will
happen because as far as the interpreter is concerned, it now
has nothing in its (new) program storage area.
Once the program has run, however, any BASIC program you load in
will start at the new, higher address (here 128 bytes up),
leaving the space immediately above the communications area free
for a machine language routine or program.
Needless to say you can vary the above program to adjust the
amount of space reserved. You'll need to change both the values
poked into the pointer locations in lines 20 and 30, and the
poke addresses in line 10.
Don't forget that if you use this method, the 'reserving'
program will have to be loaded and run ahead of the main
program, every time you want to use it. The reserving operation
can't be done from within the main program itself.
This is one disadvantage of this method; another is that it is
not easy to load in both your main basic program and the machine
language program directly from tape.
— 13 —

Advertisement

Table of Contents
loading

Related Products for Dick Smith VZ200

Table of Contents