Product specifications

and then carriage return to get into the code line and summon the assembler followed
by CLS and RET to leave it again.
This will re-assemble the code for its current location. To get around this problem it is
wise to put your code lines as near the start of the BASIC program as possible. eg:
10 GOTO 100
100 CODE
4007 LD HL,DATA
400A LD DE,DATA1
etc.
Symbols.
DATA 4013 COPY 4018
20 RETURN
100 REM START OF BASIC PROGRAM
Number Representation.
The MTX assembler will work with either decimal or Hexadecimal numbers. The
default is decimal, but by prefixing a hex number with a "£" , the number is treated as
being hexadecimal. Words are stored according to the Z80 convention, low byte first,
then high byte.
Executing Machine code.
There are two ways to execute machine code from BASIC.
The first and simplest is to place the code "in the way" of the BASIC program
execution flow. When the code line is encountered by BASIC, control will be passed to
the machine code in the code line, control is returned to BASIC by the RET statement.
Should you wish to execute the code more than once then it is best to incorporate the
code line in a BASIC subroutine which can then be called over and over. This also has
the advantage of allowing you to place the code line near the beginning of the BASIC
program and avoiding having to re-assemble the code every time the BASIC program
is edited.
The second method of executing machine code is by the use of the USR function.
Take the previous example and add the following BASIC lines to it..
5 GOTO 100
100 LET X=USR(16400)
110 STOP
If your machine is an MTX500 then line 100 should be:
100 LET X=USR(32784)
Now re-assemble the code line to take account of the fact it has been moved up the
memory by inserting line 5.