Reserving Space For A Machine Code Program - Dick Smith VZ200 Technical Reference Manual

Personal colour computer
Table of Contents

Advertisement

TOP OF MEMORY (TOM)
Default:TOM-50 bytes —I
Normally 7AE9H
START OF USER RAM
String space
BASIC stack
(free space)
VLT
BASIC program
Communications
Region
9. RESERVING SPACE FOR A MACHINE CODE PROGRAM
There are a number of ways to reserve memory space for a machine
code program, from within a BASIC program. But before details of
these methods are given, we should clarify the way that BASIC
normally organises RAM memory space.
A range of addresses at the bottom of user RAM is reserved for
system pointers and variables. This section is often termed the
"communications region". It includes locations which store
pointers to the boundaries of the various regions in upper RAM,
like the 'Top of Memory' pointer, the 'start of BASIC program'
pointer and so on. The latter pointer is stored at 78A4/5
(decimal 30884/5).
Normally the BASIC program itself is stored next, in locations
starting at address 7AE9 hex. At the end of the BASIC program
text, the system stores a table containing the program's
variables. This is known as the 'variable list table' (VLT).
This is divided into two sections: first the simple variable
table, containing simple numeric variables and pointers to the
simple string variables, and then the subscripted variable table
containing dimensioned variables.
As the BASIC program text changes in length, the VLT is moved up
or down in memory so that it always begins at the end of the
program. The pointer to the start of the VLT is stored in
location 78F9/A, and the pointer to the start of the subscripted
variable table in location 78FB/C.
The remaining major regions extend downward from the top of user
RAM. Normally at the very top of RAM is the string storage area,
extending down from the top of RAM (pointer stored at 78B1/2) by
either the default figure of 50 bytes, or a different amount
established by a CLEAR N command. The BASIC interpreter's stack
then extends downward in memory from the bottom of the string
area (pointer stored in 78A0/1).
The space between the top of the VLT region and the bottom of
the stack is not used, and is designated 'free space'. So that
normally, the RAM organisation looks like this:
— 12 —

Advertisement

Table of Contents
loading

Related Products for Dick Smith VZ200

Table of Contents