68
9 AUTOMATION
9.1 Introduction
It is possible to automate the action of Xplor8 in four ways:
1. Three commonly-used commands can be issued automatically at start-up:
• Connect / Disconnect
• Reset
• Unlock
To use this feature, tick the appropriate boxes in Settings>General.
2. A group of commands may be executed automatically immediately after the initial commands
mentioned above - see Boot Script on page 69.
3. A group of commands in a macro script named 'AUTOSTART' may be executed automatically
after booting, see Autostart Macro (page 70).
4. Any number of commands may be grouped into named macros, which can then be executed
by typing their names into the command line, or selecting one from a drop-down list.
See the section on Macros below for an explanation of macro scripts. Xplor8 includes a simple Macro
Editor for writing macro script files, or macros can be 'learnt' as you type in commands.
9.2 Macros
Macros allow a succession of commands, grouped together under a named macro heading, to be
executed sequentially, as though they were typed successively on the command line. This saves a lot
of repetitive typing. Macros are stored as plain text in Macro Library Files. Each library file can
contain an unlimited number of separate macros, and each macro can contain any number of
statements. Macro library files have the extension '.mcr', and a typical one might look like this:
* Sample Macro library file (Sample1.mcr)
*
DEFM MACRO1 {Macro to process an S19 file}
BEGIN
LD "[Xplor8]\Samples\Looptest.S19"
L 8000 +30
U6 8000
END
DEFM MACRO2 {Trace testing macro}
BEGIN
F 8000 +3F 01
LD "[Xplor8]\Samples\Looptest.S19"
L 8000 +3F
T 8000 {Trace}
T ; NOTE: comments may also begin
T // with a semicolon or 2 slashes
S
L 8000 +3F
END
Kommentare zu diesen Handbüchern