EasyManua.ls Logo

Husky Hunter - Page 134

Husky Hunter
499 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC PR<XiRAMMING
SECTION 4.8
4.8.5
4.8.6
4. 8. 6.1
When CALL is executed the register pair HL is used as an address
pointer to the bottom of the stack on which the variables are
placed:-
X HIGH
X LOW
Y HIGH
HL->Y LOW
In other words HL is addressing the low byte of the most
recently PUSHed variable. To access others then HL is
incremented. These values may either be used by the called
routine or modified and used by Basic.
It is not necessary to
preserve the contents of HL.
CONTROLLING HUNTER
Section 9.7, MEMORY LOCATIONS and 9.8, PORT ALLOCATIONS, contain
list's of available addresses of HUNTER parameters and system
call addresses. The parameters may be written or read by means
of PEEK and POKE operations. System calls may be used for
functions such as the CLOCK or communications parameters.
AVAILABLE MEMORY
By subtle use of the DEFSEG statement, to address the required
page, many places in RAM can be used for machine code implants.
However, the only place in common RAM available (whatever DEF
SEG is set to) is the serial communications buffer. Since the
communications are active continuously on receive, take care not
to let programs be corrupted.
50 hex bytes are available for
small user programs at decimal address 62981 (see section 9.7).
MACHINE CODE IN BASIC
The recommended method of storing machine code from BASIC is to
store it in a dummy string array, a method for which is outlined
below.
a) First calculate the length of the machine code and dimension a
string array with the required number of single byte elements
using the formula:
D=(N/2)-1
where
N=number of bytes needed for machine code.
and
D=number of single byte elements required in dimension.
VER.V09F
PAGE 4 - 19