BASIC PRCXiRAMMING
SECTION 4.8
4.8.6.2
To reserve lO bytes of memory, the required dimension is DIM
MC$(4,1).
NOTE: After dimensioning, all the bytes will be set to zero.
b) The start address of the reserved memory must be found. This is
done as follows:
Assuming the array name is MC$, the statement AD=VARPTR(MC$)-1
will return the address of the first reserved byte in AD.
c) To actually put the machine code into the array, a series of
POKE statements are used, i.e:
POKE AD,30,7, 14,1,205,5,0,201
NOTE: the machine code must be given as decimal numbers.
d) Finally, to execute the machine code, all that is required is
X=CALL(AD)
where X is a dummy variable and AD is the start address of the
machine code as obtained in (b) above.
NOTE: It is vitally important that DEFSEG is set to O when the
CALL is executed. If DEFSEG is altered in the program, DEFSEG=O
must be executed before the CALL is executed. It is also
important that no attempt be made to use the array which is
holding the machine code in the Basic program.
PAGING IN MACHINE CODE
In some applications the user may wish to access other pages
from a machine code program. However, this is not a trivial
matter and extreme care must be taken wheD using this facility.
The user is recommended to read section 3,3, 1 of this manual for
full details on the HUNTER memory organisation before
proceeding.
In order to use the HUNTER paging, the machine code to switch
the page must be located in the common block of ram starting at
49152 (COOOH). If the machine code is not in this block of ram,
the HUNTER will not be able to access the machine code program
once the page has been switched. In order to ensure the machine
code is located above 49152 (COOOH) the array used to hold the
machine code is the last array dimensioned. Check the start
VER.V09F
PAGE 4 - 19a