Intel AEDIT-86 Life Jacket User Manual


 
CALC
ColDlDand
AEDIT -86
User's
Guide
7-4
second occurrence of that character signifies the right end
of
the string. To prevent
ambiguity, the following characters may not serve as string delimiters: letters, digits,
blank, and tab.
A natural delimiter choice
is
a quotation mark. However, if the string constant includes
a quotation mark, a different character, one that does not appear
in
the string, should
be used as the delimiter.
The case of the letters within the string
is
preserved.
7.5
Operators
Syntactically, operators are divided into two groups: unary operators and binary
operators. From the functional point of
view,
the operators are divided into the
following groups: logical operators, relational operators, shift/rotate operators, and
arithmetic operators. Table
7-1
partially reflects this partition.
Table
7-1
lists all the CALC command operators with a brief description of the
semantics of each operator. Following are more detailed descriptions of the nontrivial
operators:
1.
- and '
(1
's complement) have the same meaning. The duplicate notation prevents
possible difficulties
on
terminals where one of these characters may have a special
meaning. 1 's complement means for every
0 bit, a 1 bit
is
returned and vice versa.
2.
! and # :
The POS operator
(!)
is
defined as
follows:
If
number > 0 then return true (
-1
)
else return false (0).
The
NEG
operator
(#)
is
defined
as
follows:
If
number > 0 then return false (0)
else return true (
-1
).
3.
\ (modulo division) returns the remainder of
an
integer division, for example, 7
\ 4 =
3;
16 \ 4 =
O.
4.
1\
(XOR)
returns true only if one operand
is
true and the other
is
false; other-
wise it returns false. This
is
done for each bit in the argument, for example,
51\1
=4.
7.5.1
Shift/Rotate
Operators
In the shift/rotate operations, the left operand
is
handled as a pattern
of
32
bits.
It
is
moved
to the right or to the left by the number of bits specified
by
the right operand.
In a shift, bits moved off one end of the pattern are lost, and
0 bits or 1 bits are
moved into the pattern from the other end. In a rotate, bits
moved
off of one end
move onto the other end.
SAL
and SAR are algebraic shift operators. This means that the high order bit
is
the
sign bit, and there
is
no shift of bits between the sign and the rest of the number. In
a left shift (SAL),
0 bits move into the pattern from the right. In a right shift (SAR),
either
0 bits (if pattern
is
positive) or 1 bits (if pattern is negative) move into the
pattern from the left.
In every shift/rotate operation, the right operand (count)
is
always taken as modulo
256.