Symbol Definitions; Explicit Constants - RCA 1800 Operator's Manual

Cosmac development system ii
Hide thumbs Also See for 1800:
Table of Contents

Advertisement

56 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Operator Manual for the RCA CDS II CDP18S005
A comment is any series of characters begin-
I:1ing with two periods. It extends to the end of the
line. Thus, the occurrence of two periods at any point
in a line causes CRA to ignore the remainder of the
line. Statements within a line are normally separated
by semicolons (with the last statement optionally
terminated by a semicolon). Within each statement,
spaces (blanks) maybe used freely (except within
.
symbolics and mnemonics) in order to improve
readability. CRA will ignore them.
In all the examples which follow, a pair of square
brackets will be used to enclose an optional entity -
one which mayor may not be included. Examples of
valid lines are then:
1) .. COMMENT
2) STATEMENT! [;STATEMENT
2 ; · · · ;
STATEMENT
n ] [;] [ ..
COMMENT]
Sym bol Detin itions
(Statement Labels and Equate Statements)
Any statement may optionally begin with a
symbol (called a "statement label") immediately
followed by a colon. Under these conditions, the
symbol is entered into the symbol table and assigned
the present location counter value. A statement thus
has the form:
[SYMBOL:] STATEMENT BODY
(For example, LOOP: INC R4)
A symbol is also defined when it appears as the left-
hand part of an EQUATE statement, which has the
form:
SYMBOL=EXPRESSION
(For example, READER=6)
In this case, the expression is evaluated and the
resulting two-byte value is assigned to the symbol in
the symbol table. (Acceptable forms for symbols and
expressions have already been explained.)
Thus, a symbol definition is indicated to CRA by
the occurrence of ":" or "=" immediately after a
leading sequence of alphanumeric characters in a
statement.
When equating a symbol to a register number, only
a decimal or a hexadecimal number should appear on
the right side of the equation. For example:
COUNTR= 7 is correct
COUNTR= #07 is correct
COUNTR= R7 is incorrect
DELAY = COUNTR is also correct
Explicit Constants
At numerous points in the source program, the
programmer desires to directly
~pecify
explicit
constants to CRA. Most often (but not always) the
hexadecimal equivalent of an explicit constant is
inserted directly into the output code stream at the
point where it appears in the source program. (For
example,
initial
data
values
and
immediate
arguments may be explicitly defined this way.) CRA
allows the programmer the ability to specify absolute
constants in binary, hexadecimal, decimal, and
alphanumeric forms. The possible explicit constants
are summarized below.
Hexadecimal constants: A hex constant is specified
with either of the following forms:
Example
1)
#hh ... hh
#3EOF
2) X'hh .. hh'
X'3EOF'
where each h is a hex digit (0 to F). eRA requires
that an even number of hex digits be specified.
There are further restrictions on hex constant lengths
under certain conditions.
Decimal constants: A decimal constant is specified
with either of the following forms:
Example
1) dd ... dd
635
2) F'dd ... dd'
D'635'
where each d is a decimal digit (0 to 9). Each such
constant is converted into hex, producing one or two
bytes, depending on the space required to represent
it. Decimal values greater than 65535 are converted to
hex.
but then truncated to two bytes (upper bytes
removed).
Expression constants: An expression constant may
be either form of the hex constant or the first form of
the decimal constant. Because an expression tran-
Ii
slates to two bytes, a hex expression constant should
"
normally
be restricted to two or four digits in length.

Advertisement

Table of Contents
loading

Table of Contents