Intel AEDIT-86 Life Jacket User Manual


 
AEDIT -86 User's Guide
Advanced
AEDIT
-86 Usage
(e.g.,
ISDEL,
CURCH
= 20H).
The
method consists
of
two nested macros.
The
"low
level" macro advances one character and fails when the condition
is
not met (named
Advance_One).
The
"main"
macro executes the first one an infinite number
of
times
and
actually terminates when the condition is not met, and continues with the next
instruction:
Advance_While:
... /
E(XECUTE)
Advance_One ...
Advance_One:
C(ALC)
N9=!cond
<
FETN)
9
F{lND)
- <
RUBOUT)
(ESC)
(RIGHT)
or in macro form:
MAdvance_ While \ BR ...
/EAdvance_One \
NL.
..
MAdvance_One \
BRCN9=!cond\
NL
\
XN9F-
\ RB \ BR \
CR
...
If,
for example, you want to implement skip to the next
blank/tab,
then cond
is
"CURCH<>20H
&
CURCH<>09H".
To
implement Backward_While (cond), the same method
is
used, but the last
command in
Advance_One should be <
LEFT)
(\
Cl)
instead of
(RIGHT)
( \
CR).
8.3
Examples
The
examples included in this section are macros from
USEFUL.MAC.
They
are
explained in greater detail to show the usage of the above techniques.
8.3.
1 Example 1
The
following set
of
macros converts single letters or words from uppercase to lower-
case
or
vice versa.
It
executes nested macros (e.g
..
macro l calls macro
U2l),
uses
the
CALC
comma'tld (e.g.,
C(AlC)
n8=(n9=lowch)
and read-only variables (e.g.,
lowch, curch, upch), calls the
SET
command
(S(ET)
R(adix) A) and the fetch
function (e.g.,
<
FETN
) 8).
Ml
\ BReu21 \
NL
\
CR
\
XN8eLUll
\ BR \
MM;
\ * letter to lower case * \
MU
\ BRel2u \
NL
\
CR
\
XN8eLU
II
\ BR \
MM;
\ * letter to upper case * \
M_
\
BRe+W
\
NL/e1l2
\
NLe+W
\ BR \
MM;
\ * word to lower case * \
M/\
\
BRe+W
\
NL/eu12
\
NLe+W
\ BR \
MM;
\ * word to upper case * \
_________
MU2L
\
BRCN8=(N9=lowch)<>curch
\
Nl
\
MM;
ML2U
\
BRCN8=(N9=upch
)<>curch
\
NL
\ MM;
MLUII
\ BR \ CLsrax \
XN9
\ BR \
MM;
MLI2
\
BRCN7=iswhte
I eof \
NL
\
XN7f-
\ RB \ BRI \ MM;
MUI2
\
BRCN7=iswhte
I
eof\
NL
\
XN7f-
\ RB \ BRu \
MM;
Note
the
use
of
the following techniques:
Macro L executes
LUI
I using the
IF
cond
THEN
statement
Macro
L12 simulates Advance_While the current character is not a white space.
In this case,
it
also converts the character to lowercase.
Macro
_ (underscore) uses + W to skip to the next nonwhite space character.
8-5