Prism
Operation Manual Issue 2.00
Page 7.22
7.4.2.2.
Macro File format
Macro Files may contain the following:
q
Keywords - the various instructions that make up the Macro;
q
Labels - usually the destination of JUMP instructions;
q
Comments - remarks to aid readability, ignored by Macro Processor;
Keywords are the individual commands to the Macro Processor. These may be
separated by semicolons or spaces on the same line to reduce the file length if
required. Each Keyword is processed in sequence and causes an effect either within
the DSA-1 or in the host PC.
JUMP
-type Keywords enable loops and other program
flow changes.
Labels are usually the destinations of
JUMP
-type Keywords. They may be up to 20
characters long and always start with an '@' character. The final colon is used at the
label point but NOT in the reference to it. After branching, execution of Macro File
resumes at the Keyword immediately following the destination label. Labels take the
form:
JUMP(@bad_jitter)
// reference to label
...
/* here is the label itself... */
@bad_jitter: BEEP
Comments exist in two forms, both illustrated in the label example above. The '//' form
causes all further text on that line to be considered a comment and thus be ignored by
the Macro Processor. The '/*..*/' form encloses the comment (which may be on several
lines) but allows active Keywords to follow the final '*/' on the same line. Comments
have no effect on the action or flow of the Macro File, and merely serve to explain the
Macro File's actions to increase readability.
The Macro File extract below enters the fs frequency sub-menu (the extract assumes
that the menu system is offering sub-menu 1.1. on entry), records the result and takes
various actions according to the accuracy of the fs reading:
ENTER // enter fs frequency sub-menu
GET_DSA_VAL(1,6,13); // get fs (5 two decimals)
PRINT("\n\r fs is \v."); // and print it out
/* Now test the fs value - fail if more than 1Hz from 48kHz */
JL(47999,@bad); JG(48001.0,@bad) // fs is out of range
PRINT("fs PASSED"); // OK
JUMP(@cont); // and continue
@bad:
PRINT(" *** fs outside 47999 - 48001 Hz"); // fail message
WAIT_ANY_KEY