Download Print this page

RCA Spectra 70 Training Manual page 21

System
Hide thumbs

Advertisement

The Controlling Code,
NAME
OPERATION
OPERAND
START
Xt7D~t
places the initial value of (2000ho in the Location
counter. As memory is allocated for fields and
instructions, the counter is incremented so that it
always contains the address at the next location avail-
able.
If
a statement contains a name, that name is
placed in the table, and assigned an address equal to
the current value in the counter.
Consider the following examples:
FOR TillS
LINE
SYMBOL
ADVANCE
ASSEMBLY
CONTENTS
(TAG)
ADDRESS
LOCATION
STATEMENT
OF LINE
~
ASSIGNED
COUNTER TO:
A 5-byte field
Work
2000
2000
A 2-byte field
ADDR
2005
2005
A lO-byte Constant
WCON
2007
2007
A 6-byte Instruction
STRT
2018
2018
*
A 4-byte Instruction
2024
**
*Note that the Location Counter is advanced one byte location by the Assembler
to orient the instruction to an even address.
**NO SYMBOL (TAG) ASSIGNED.
IMPLICIT BASE ADDRESS SYSTEM
The User may explicitly state base register values in
his Assembly Statements, or he may ask the Assem-
bler to assign base addresses and compute displace-
ments. This latter method is called the implicit Base
Address System. Base values are considered to be
implied whenever they are not explicitly stated.
NAME
OPERATION
OPERAND
MVC
Dl (L. B l ). D2 (B 2 )
Explicit Base Addresses
MVC
SI (L). S2
Implied Base Addresses
We tell the Assembly what base addresses to use,
for implicit assignment, through a series of Using
Statements.
NAME
OPERATION
OPERAND
START
USING
USING
USING
X'064'
*.9
4195.10
*+8190.11
Set Location Counter to
100(10)
Using
100(10)
in General Register
9
USing
4195(10)
in Genera) Register
10
USing
8290(10)
in General Register
11
With this information, the Assembly selects the base-
address that gives the least displacement, and com-
putes the B1-D1 (or B2- D 2) field in the object instruc-
tion.
Assume the two names ABLE and BAKER have been
assigned the addresses 3850(10) and 8173(10) in the
symbol table. The assembly subtracts a smaller
base value from the effective (Symbol Table) Address.
The difference is the displacement.
15
3850
8173
0100
4195
3750
3978
If
the displacement exceeds 4095, the statement is
flagged.
If
we move ABLE to BAKER the object result is:
OP
I
L
I
I
I
I
I
D2(16)
~I
00(16)
I
I
I
9(16)
3750(10)
A(16)
I 3978(10)
I
I
I
Additional rules for implicit aadress generation:
1.
If
more than one register produces a valid dis-
placement (notover4095(10», the register whose
contents produce the smallest displacement is
used.
2.
If two or more registers produce the same dis-
placement the highest numbered register is used.
3.
If no register produces a valid displacement the
object instruction contains anOP code and zeros.
The statement is flagged.
4.
The UsingStatementis an Assembly Controlling
Code. The User must write additional instruc-
tions and constants to physically load and manip-
ulate register contents.
5.
Address values to be stored in general registers
for base address purposes should be defined with
an address constant controlling code (DC, A
option) • If other means are used, the program
block will not be relocatable. Float factors are
added to address constants, not to the displace-
ment values.
RELATIVE ADDRESSING
As mentioned above, a symbol appearing in the NAME
field has an address assigned by the Location Counter.
The aSSignment will be the address of the leftmost
byte of the defined field.
The programmer may reference any location to the
right or left of this address by indicating a plus
(+)
or minus (-) value.
As an example, assume a field (WARE) has been
assigned as follows:
WARE
[ 30
1-1_°° __ °1 __
02_0_3-1

Advertisement

loading

  Also See for RCA Spectra 70

  Related Manuals for RCA Spectra 70

This manual is also suitable for:

Spectra 70/25