Chapter 7.
Expressions
An expression specifies an address or numeric value. Whitespace may precede and/or follow an ex
pression.
The result of an expression must be an absolute number, or else an offset into a particular section. If an
expression is not absolute, and there is not enough information when
as
sees the expression to know
its section, a second pass over the source program might be necessary to interpret the expression but
the second pass is currently not implemented.
as
aborts with an error message in this situation.
7.1. Empty Expressions
An empty expression has no value: it is just whitespace or null. Wherever an absolute expression is
required, you may omit the expression, and
as
assumes a value of (absolute) 0. This is compatible
with other assemblers.
7.2. Integer Expressions
An integer expression is one or more arguments delimited by operators.
7.2.1. Arguments
Arguments are symbols, numbers or subexpressions. In other contexts arguments are sometimes called
"arithmetic operands". In this manual, to avoid confusing them with the "instruction operands" of the
machine language, we use the term "argument" to refer to parts of expressions only, reserving the
word "operand" to refer only to machine instruction operands.
Symbols are evaluated to yield {
section NNN
} where
section
is one of text, data, bss, absolute, or
undefined.
NNN
is a signed, 2's complement 32 bit integer.
Numbers are usually integers.
A number can be a flonum or bignum. In this case, you are warned that only the low order 32 bits are
used, and
as
pretends these 32 bits are an integer. You may write integer manipulating instructions
that act on exotic constants, compatible with other assemblers.
Subexpressions are a left parenthesis
(
followed by an integer expression, followed by a right paren
thesis
)
; or a prefix operator followed by an argument.
7.2.2. Operators
Operators are arithmetic functions, like
+
or
%
. Prefix operators are followed by an argument. Infix
operators appear between their arguments. Operators may be preceded and/or followed by whitespace.
7.2.3. Prefix Operator
as
has the following prefix operators. They each take one argument, which must be absolute.
Negation. Two's complement negation.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved