Intel AEDIT-86 Life Jacket User Manual


 
CHAPTER 7
CALC
COMMAND
The
CALC
command provides you with computation capabilities. These capabilities
coupled with AEDIT-86 variables enable the following, for example: centering a
phrase on a line, finding the size of an input file, or changing a letter from lowercase
to uppercase or vice versa.
To
execute the
CALC
command, press C; AEDIT-86
prompts-
----
<HOME)
to
re-edit
C
IS
1 c :
The last statement entered under
CALC
is displayed to the right of the colon.
7.
1 Introduction
Either a numeric or a string statement
is
legal input to a
CALC
command.
In
general,
the statement
is
either an assignment statement or merely an expression. A
CALC
expression
is
comparable to expressions in many other programming languages. It
includes logical operators, relational operators,
shift/rotate
operators, and arithmetic
operators. As usual, an expression may include parentheses. These, plus the prece-
dence and associativity rules
of
the operators, completely define the evaluation order.
The operators act on the following elements: numeric constant (integers only), string
constants, AEDIT-86 numeric local variables, N-variables, and S-variables.
Arithmetic using
the
CALC
command
is
32-bit signed arithmetic.
No
overflow
detection is performed.
7.2
Syntax Diagrams for CALC Statement
This section presents
the
CALC
input syntax in syntax diagram form.
In
these
diagrams, every path you can follow in the direction
of
the arrow represents a
syntactically correct construct
of
CALC
input. Terminal symbols
of
the language,
keywords, letter symbols, and punctuation symbols that
are
typed verbatim as
CALC
input
are
enclosed
in
circles or ovals. Nonterminal symbols (terms standing for
language constructs that are defined in their own syntax diagrams) are enclosed
in
rectangles.
ILstatement:
[
1...-
1
_L
.......
_nt
---Jl--~
-I,--_·X_pr,,_sion~~_.
t
v-r-
7-1