Adrl; Lpool Directive; Adrl Directive - Xerox 530 Language And Operations Reference Manual

Table of Contents

Advertisement

ina literal pool. Thus, literal pools must be declared within
self-relative addressing range of such occurrences. Address-
ing may be non-relative, self-relotive, or bose-relative.
Address literals may also be declared by the programmer
through use of the ADRL directive.
ADRL
Generate Address Literal
This directive has the form
L:~:~,
__
~ --;~C"-"<J_+-~~;~~~--
where
lobel
is any valid symbol. Useofa label isoptional.
When present, it
IS
assigned the current value of
the execution location counter.
Both location
counters are i ncrementeC by one.
expression
is any single-termed or multitermed
0xpression other than a literal.
This directive causes the ClSsembler to generate one word
containing the address value ossigned to the symbol.
The value "symbol" is placed in the literal table. However,
it is togged to indicate thot it is not to be output in a lit-
eral pool.
Any Class
1
instruction or Gen
1
directive within address-
ing range of the ADRL may use the value "symbol" as on
indirect address as shown in the e)wmple below.
Example
6.
ADRL Directive
If it is nccessarytoreferenceaninstruction labeled VAL,
but VAL is out of dilect addressing ronge, the folhwintJ
statements uccornplish the
task
without
the
nc'ed for the
LPOOL directive.
ADDRS
ADRL
VAL
ADDRS
ADRL
VAL
or
B
VAL
B
*ADDRS
The ADRL directive must be within addlessing ronge of
the bran,:;h instruction.
The reference, B VAL, is handled in the some manner as
if the address literal were invob:d by fhe assembler.
The ADRL directive also provides a method for transmitting
data addresses to subroutines.
For example, if the items
A, B, and C are required by a subroutine, the calling pro-
gram can provide the addresses of these items and the branch
to the subroutine with the fo !lowing statements.
Example
7.
ADRL Directive
CALL
RCPYI
1,5
Address CALL+
2
copied into
base register
B
*$
+
1
Indi rect branch to subroutine
ADRL
SUBR
Address of subrouti ne
ADRL
A
Address of A
ADRL
B
Address of B
ADRL
C
Address of C
(return)
The subrouti ne can reference A,
B,
and C by usi
i~g
the ad-
dresses generated by the ADRL directives.
Since the
address CALL
+
2
is in the base register, the subroutine has
access to itemsA,
B, C
by indirect addressing through the
base register. For example, the subroutine below selects
the larger of A and
B and makes it C. If A:c::B, C is given
the value of
0.
SUBR
LDA
"'1" 1
Load A
into accumu lator
CP
*2,,1
Compare A to B
BNO
$+5
Branch if A
<
B
BNC
$12
Branch if
A :> B
RCPY
0,7
Clears occurnulator.
STA
*3, ,1
Makes C
:.:-c
(accumulator)
B
A, ,1
Return to culling program
LDA
*
~t I"
Load
B
into accumu lator
B
$-3
I t is !,uggested thot programmers precede each program seg-
ment smaller than 256 instructions with a list of ADRL's
containing symbols referenced outs:de the segment.
If
this
is done, the taskof debugging a program is made easier be-
cause the addressesof all such symbols appear in the address
litemls at the beginning of the segment.
Thus, time spent
in search ing through the I isti ng for address va lues is eli mi nated.
Address
Li tera Is
23

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sigma 3Sigma 2

Table of Contents