Z8000 Asm
Z8000 Asm
Z8000 Asm
iii
iv
Contents
SECTION 1. ARCHITECTURAL OVERVIEW 1-1
1.1 INTRODUCTION 1-1
1.2 MEMORY ADDRESS SPACES 1-3
vi
CONTENTS (continued)
Vll
E3-3055-01 07/02/79
CONTENTS (continued)
LIST OF TABLES
LIST OF ILLUSTRATIONS
vni
CONTENTS (continued)
1.1 INTRODUCTION
• Segmentation
1-1
• Stacks
The Z8000 has several instructions which facilitate the
handling of stacks (Section 1.5.3). A "stack" is an area
of memory used for temporary storage or re-entrant
procedure call/interrupt service linkage information, and
is managed in a "last-in, first-out" manner; that is,
several items may be "pushed" or added to the top of a
stack and then "popped" or removed from the stack in
reverse order. On the Z8000, a stack starts at the highest
address allocated for it and grows linearly downward to the
lowest address as items are pushed. A general-purpose
register is used to "point" to the current top of the
stack; that is, the register contains the address of the
most recently-pushed item.
1-2
Attempting to execute privileged System mode instructions
while in Normal mode initiates a trap. This is an
important feature in a multi-user environment. Programs
running in normal mode cannot take over or monopolize
control of the Z8000 or damage other users' programs or
system software. System mode is also in effect following
an interrupt or trap.
NOTE
1-3
ÄS AD15 « » >
BUS, DS AD14 -*— *-
TIMING
MREQ AD13 •+-+-
AD12 -*—»-
READ/WRITE AD,,
-*— *-
NORMAL/SYSTEM AD10
"*-*"
BYTE/WORD ADg
AD8 ADDRESS/
STATUS<
ST3 AD7 DATA BUS
^ ^
ST2 AD6
-*— *-
ST, AD5 -«— »-
ST0 AD„
-*—*-
AD3 -*— »-
WATT 28OO1 AD2
CONTROL STOP Z8002
AD,
^ ^
AD0 •*-*-J
BUS BUSRQ
CONTROL< BUSAK [ * SN6 —^
Z8OO1
ONLY
| SN5
NMI i SN4
INTERRUPTS-; SEGMENT
vT | SN3
NUMBER
NVT 1 SN2
SNl
1 ^
MULTI-MICRO M, | SN0 ^^
CONTROL MO
SEGMENT
LSEGT
"* TRAP fs^_.
m r
+ 5 V GND CLK RESET
1-4
1.2.1 Four Memory Address Spaces
1-5
In the case of a bit or digit, the memory address designates the
byte or word that contains it. For example, a bit can be
addressed by specifying a byte address and the number of the bit
within the byte (0-7) , or by specifying a word address and the
bit number within the word (0-15). Bits are numbered
right-to-left; that is, least-to-most significant (Figure 1-2).
In the case of data types longer than one byte, the memory
address designates the leftmost, or high-order byte. In other
words, the high-order byte has the lowest memory address of the
bytes within a word or long word (Figure 1-2).
Program instructions residing in code memory are always addressed
as 16-bit words. Words and instructions are always aligned (the
high-order byte must have an even-numbered address)"! Aligned
words improve access speed and double the range of instructions
that use relative addresses (JR, DJNZ, DBJNZ, CALR) — see
Section 1.5.4. The memory address of a long word must also be an
even-numbered byte address.
NOTE
1-6
7 6 5 4 3 2 1 0
BITS IN A BYTE
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BITS IN A WORD
BYTE
i i i i i
UPPER WORD
i i i i i i i i i i i i i i i
•LONG WORD
LOWER WORD
i i i i i i i i i i i i
1-7
l.4 SEGMENTATION
1-8
logical address spaces into the same physical addresses.
Relocation, protection and/or virtual memory facilities may
be shared by several processors as well.
1-9
0 7
r segment number
15
long offset
i i i i i
SHADED AREAS ARE RESERVED
0 7
1 segment number
i r i i i
15
long offset
0 7
segment number short offset
i i i i i i
1-10
1.4.2 Memory Management
1-11
(BIDIRECTIONAL)
D7-D0
AD 7 -AD 0
Z8000 A 7 -A 0
CPU
AD15-AD8
MEMORY
MANAGEMENT
UNIT
A
23~A0
SN6-SN0
SEGMENT NUMBER
TRAP
ST3-ST0
STATUS
1-12
LOGICAL PHYSICAL
ADDRESSING ADDRESSING
SPACE SPACE
000000
SEGMENT 0
0000
ELEMENT
ADDRESSED
UP TO
FFFF
FFFFFF
1-13
15 8 7
/"MEMORY
MANAGEMENT
UNIT
BASE
ADDRESS
MEMORY
23 16 15 \/ 87
00000000
ADD
15
T
00000000 I
I
23 8 7
1-14
1.5 DATA MANIPULATION
The two remaining data types, not discussed thus far are:
• Strings of bytes
• Strings of words
1-15
Strings can be stored and referenced only in memory. They are
referenced by designating either their lowest or their highest
byte address plus their length in bytes or words. They are used
with Z8000 "autoincrement" or "autodecrement" instructions, which
automatically increase or decrease the pointer to a byte or word
address (Figure 1-8). Note that when strings are used, the
programmer must designate the length of the data element
explicitly, as one of the instruction operands.
• RHO, RLO, RH1, RLl, ..., RH7, RL7 for 8-bit registers.
("H" stands for high-order byte, and "L" stands for
low-order byte within a word register). These registers
overlap 16-bit registers RO - R7. All 8-bit registers
can be used as accumulators.
• RRO, RR2, RR4, ..., RR14 for 32-bit register pairs.
1-16
LOWEST BYTE
ADDRESS
(AUTOINCREMENT)
i i i i i i
LENGTH IN BYTES AS ONE
OR OF THE OPERANDS
i i i i i i i
HIGHEST BYTE
ADDRESS
(AUTODECEMENT)
BYTE STRING
15
LOWEST WORD
ADDRESS i i i i i i i i i
(AUTOINCREMENT)
l l l l i
i i i i l i i l i i i i i i
LENGTH IN WORDS
OR AS ONE OF THE
OPERANDS
i i i i i i i i i i i i
HIGHEST WORD
ADDRESS i i i i i i
(AUTODECREMENT)
WORD STRING
1-17
programmer-maintained stack pointer with instructions such as
Push and Pop, multiple stacks can be efficiently supported. The
stack pointers (pointers to stack locations in data memory) are
kept in general-purpose registers and, therefore, can be altered
using standard instructions. No special stack-pointer
instructions are needed.
The processor stack is used implicitly by certain operations such
as the Call and Return instructions or the interrupt and trap
mechanisms. Depending on the System or Normal mode, these
operations use a hardware-defined stack pointer to access either
the system processor stack or the normal processor stack.
As Figure 1-9 also shows, two copies of the stack pointer are
needed -- one for the system stack and one for the normal stack.
Although the stacks are separated in memory, the normal stack
pointer (NSP) register can be accessed while in System mode using
the Load Control Register (LDCTL) instruction.
The two sets of stack pointers make task-switching easier. To
make sure the normal stack is always free of system information,
the normal program status data saved when an interrupt or trap
occurs is pushed onto the system stack before the new program
status is loaded (see Sections 1.6.4 and 1.6.5).
1-18
I
RQ 7 RHO 0 7 RLO 0
RRO
R1 15 RH1 RL1 0
RQO
I
R2 RH2 RL2
RR2 .
R3 RH3 RL3
R4 RH4 RL4
(
RR4
I R5 RH5 RL5
RQ4
| R6 RH6 RL6
RR6
I «7 RH7 RL7
I
R8 GENERAL
RR8
REGISTERS
R9
RQ8
R1
| °
RR10
( R11
R12
|
RR12
( R13
1-19
Immediate Data (IM)
Register (R)
Indirect Register (IR)
Direct Address (DA)
Indexed Address (X)
Relative Address (RA)
Based Address (BA)
Based Indexed Address (BX)
Immediate Data
OPERAND
Register Addressing
In Register addressing mode, the instruction processes data taken
from a specified general-purpose register. Storing data in a
register allows shorter instructions and- faster execution.
REG
INSTRUCTION »- OPERAND
1-20
Indirect Register Addressing
In Indirect Register addressing mode, the data processed is not
the value in the specified register. Instead, the register holds
the address of the data.
REG
INSTRUCTION »- ADDRESS OPERAND
Direct Addressing
INSTRUCTION
J
ADDRESS H OPERAND
1-21
Indexed Addressing
REG
INSTRUCTION |—
|
ADDRESS
Relative Addressing
PC
•GH
INSTRUCTION ADDRESS
DISPLACEMENT H + I H OPERAND
1-22
As with Direct Address mode, Relative Address is also used by
certain program control instructions to specify the address of
the next instruction to be executed (specifically, the result of
the addition of the program counter and the displacement is
loaded into the program counter).
Based Addressing
REG
1 1
1 INSTRUCTION 1—
/~\
»I t 1 »1 OPFRAND 1
1-23
REG
INSTRUCTION -»-I ADDRESS
REG
DISPLACEMENT H + I H OPERAND
The status flags, control bits, and program counter are referred
to collectively as the Program Status (PS). The Program Status
is contained in two or four words, depending on whether the
nonsegmented or segmented version of the Z8000 is used (Figure
1-11). The status flags and control bits are referred to
collectively as the Flags and Control Word (FCW).
1-24
15 8 7 4 3
opcode W/B src reg dst reg
15 8 7 4 3
ADD R, DA mode opcode w/B reg
0 0 0 0
ADDS R, DA
direct address
i i i i i i i i i i i
15 12 11 8 7
PROGRAM COUNTER
NONSEGMENTED
15
Kiw£
PC SEGMENT NUMBER
SEGMENTED
1-25
1.6.1 Program Counter
The Program Counter (PC) contains the address in program memory
of the next instruction to be executed. As shown in Figure 1-11,
the Program Counter is 16 bits for the nonsegmented version and
32 bits for the segmented version. The segmented address format
is described in Section 1.4.1.
1.6.2 Status Flags
Status Flags (FLAGS) can be used to determine the outcome of
certain operations and to redirect the flow of the program as
necessary. The program status has six flags for the use of the
programmer and the Z8000 processor:
Carry (C)
Zero (Z)
Sign (S)
Parity/Overflow (P/V)
Decimal Adjust (D)
Half Carry (H)
The carry (C) flag, when set, generally indicates a carry out of
the high-order bit position of a register being used as an
accumulator. For example, adding two 8-bit numbers causes a
carry out of bit 7 and sets the carry flag:
Bit
7 6 5 4 3 2 1 0
225 1 1 1 0 0 0 0 1
64 0 1 0 0 0 0 0 0
289 f— 0 0 1 0 0 0 0 1
= c a r r y flag
1-26
The zero (Z) flag is set when the result register's contents are
zero following certain operations.
The sign (S) flag is set to one when the most significant bit of
a result register contains a one (a negative number in
two1s-complement notation) following certain operations.
120 0 1 1 1 1 0 0 0
105 0 1 1 0 1 0 0 1
225 — 1 1 1 0 0 0 0 1
0 = c a r r y flag
1-27
1.6.3 Control Bits
1-28
Non-Maskable interrupts cannot be disabled, and are usually
reserved for critical external events that require immediate
attention. Vectored interrupts cause a 16-bit value output by
the interrupting device to be read from the data bus (ADO-AD15).
This "vector" value is used to select a particular interrupt
procedure to automatically branch to (Section 1.6.5).
Non-Vectored interrupts are all handled by the same interrupt
procedure, which may "poll" the external devices to determine
which one requires attention.
• Unimplemented instructions
• Privileged instructions in Normal mode
• Segmentation violations
• System call
1-29
The System Call instruction (SC) provides a controlled access
from Normal mode software to System mode software, and is handled
in a manner similar to the other traps.
Because it is possible for several interrupts or traps to occur
simultaneously, a priority for selecting which kind of interrupt
or trap is honored first is established by the Z8000
architecture. The descending priority order of the traps and
interrupts is: internal trap (unimplemented instructions,
privileged instructions and the System Call instruction),
Non-Maskable interrupt, Segmentation trap, Vectored interrupt,
and Non-Vectored interrupt.
Interrupts and traps are handled similarly by the Z8000 hardware.
At the start of the interrupt or trap sequence, the Z8000 is
forced into System mode. In addition, the segmented version of
the Z8000 is forced into Segmentation mode, regardless of the
current mode. The program status information in effect just
prior to the interrupt or trap is pushed onto the system stack.
An additional word, indicating the "identifier" for the interrupt
or trap, is also pushed onto the system stack, where it can be
accessed by the interrupt or trap handler (Figure 1-12). The new
program status is set up as described in the following section
(which includes loading the program counter with the starting
address of the procedure for servicing the interrupt or trap),
and then control is transferred to the service procedure.
1-30
NONSEGMENTED SEGMENTED
LOW LOW
ADDRESS ADDRESS
SP AFTER IDENTIFIER
STACK POINTER
AFTER TRAP IDENTIFIER FCW
OR INTERRUPT
FCW PC SEGMENT
PC PC OFFSET
STACK POINTER
BEFORE TRAP SP BEFORE
OR INTERRUPT
-1 WORD- 1 WORD-
HIGH HIGH
ADDRESS ADDRESS
1-31
PROGRAM STATUS AREA POINTER
OFFSET* RESERVED
(NON-SEGMENTED'
Z8000)
UNIMPLEMENTED
INSTRUCTION
16
PRIVILEGED
INSTRUCTION
12 24
SYSTEM CALL
INSTRUCTION
16
SEGMENT
32
TRAP**
20
NON-MASKABLE
40
INTERRUPT
24 48
NON-VECTORED
INTERRUPT
28 VECTORED INT. 56
30 NEW PC 60
32 NEW PC 64
34 68
36 72
•OFFSETS IN BYTES VECTORED
"UNUSED FOR NON-SEGMENTED Z8000 INTERRUPT
JUMP TABLE
NEW PC
540 1080
t/-?« n - /i\V
F i g u r e 1-13 Program Status Area
1-32
.J
For each kind of interrupt or trap other than a Vectored
interrupt, there is a single program status block that is
automatically loaded into the Program Status registers (which
includes the Flags and Control Word and the Program Counter).
Control is then passed to the service procedure whose starting
address is contained in the Program Counter.
For all Vectored interrupts, the same Flags and Control Word
(FCW) is loaded from the corresponding program status block.
However, the appropriate Program Counter (PC) value is selected
from up to 256 different values in the Program Status Area. The
low-order eight bits of the "identifier" placed on the data bus
by the interrupting device is used as an index into the Program
Status Area following the FCW for Vectored interrupts. The
"identifier" value 0 selects the first PC value, the value 1
selects the second PC, and so on up to the "identifier" value
255.
1-33
PSAP upper offset
NONSEGMENTED
PSAPSEG
I. i
segment number
i i i i i
15 14 98
RATE COUNTER
REFRESH ENABLE
1-34
The refresh rate (the time between successive refreshes) is
determined by the 6-bit prescaler. This is a modulo-n counter (n
= 1-64) driven at one-fourth the system clock rate. Thus, with a
4 MHz clock, the refresh period is programmable from 1 to 64
microseconds.
The refresh row counter is 9 bits and is incremented by 2 each
time the prescaler times out (reaches zero). This allows up to
256 rows for future high-density memories. (Currently available
16K dynamic RAMs have 128 rows.)
Memory refresh can be totally disabled, if necessary, by setting
bit 15 of the refresh register to zero.
1-35
Nonsegmented programs can be run in one segment of the segmented
Z8000 by setting the Segmentation mode control bit to zero with
the LDPS or LDCTL instructions. In this case, the current^valjoe
of the Program Counter's segment number is used for all memory
accesses. While "running the segmented Z8000 in Nonsegmented
mode", the rules of nonsegmented addressing mode arithmetic
apply.
1-36
Section 2
Z8000 Assembler Conventions
2-1
2.2 ASSEMBLY LANGUAGE STATEMENT FORMAT
• Operand(s)
• Comments
The statement label and comment fields are always optional. The
statement has zero or more operands, depending on the instruction
selected. The following statements have the same effect in a
Z8000 program, but the second is more descriptive (and
consequently more helpful in program debugging) .
2-2
labeil: Iabel2: ... labein: statement
2.2.2 Instruction
2-3
ADD RO, Rl !Add word operands!
ADDB RHO, RLO !Add byte operands!
ADDL RRO, RR2 !Add long operands!
2-4
LD RO, #K ILoad constant K into reg 0!
2.2.4 Comments
Comments are used to document program code as a guide to program
logic and also to simplify present or future program debugging.
Comments can be inserted anywhere a program delimiter may appear.
Comments are bounded by exclamation points (!) and can contain
any characters except the exclamation point itself.
IModule 3, Changed 7-25-78!
RES R15, #3 !?!
A single comment can cross line boundaries; that is, carriage
returns can occur within a comment.
2-5
2.3 ARITHMETIC OPERANDS
LD RO, #(22/7 + X)
JP Z, LOOP1 + 12
2-6
LDB RL4, #X+22 IResult of (X+22) must be in
range -128 to 255!
JP X+22 IModulo 65536. Result is the
address 22 bytes beyond X!
2.3.2 Constants
A constant value is one that doesn't change throughout the
program. Constants may be expressed as numbers, as character
sequences, or as a symbolic name representing a constant value.
Numbers can be written in decimal, hexadecimal, binary, or octal
notation. The latter three are preceded by a percent sign (%)
and, in the case of binary and octal, by a base specifier
enclosed in parentheses. If a number has no prefix, decimal is
assumed.
10 decimal
hexadecimal
%AFOF hexadecimal
%(2)10110010 binary
%(8)70 octal
A character sequence is a sequence of one or more characters
enclosed in single quote marks. Any ASCII character (except a
percent sign or single quote) can be included in the character
sequence.
'A1
'This is a character sequence1
A character can also be represented in a character sequence in
the form "%hh," where "hh" is the hexadecimal equivalent of the
ASCII code for the character. (See Appendix E for the ASCII
character set and its hexadecimal equivalents.)
'Here is an ESC character: %1B'
For convenience, certain ASCII characters have been assigned
shorter, more mnemonic codes as follows:
%L or Linefeed
%T or %t Tab
%R or %r Carriage Return
%P or %p Page (Form Feed)
Percent Sign
%Q or %q Single Quote
2-7
Example:
2-8
NOTE
2-9
In this example, "INTERNAL" is the scope of the variable SWITCHl,
and "BYTE" is its type.
Variables can have GLOBAL, EXTERNAL, INTERNAL, or LOCAL scope.
They can be one of the "simple" types BYTE or SHORT_INTEGER (for
8-bit values), WORD or INTEGER (for 16-bit values), or LONG or
LONG_INTEGER (for 32-bit values). They can also be one of the
"structured" types ARRAY or RECORD. (Section 5.3.4 discusses
variable declaration in more detail.)
* Unsigned multiplication
/ Unsigned division
MOD Unsigned modulus
The division operator (/) truncates any remainder. The MOD
operator returns the remainder from dividing its operands.
17/4 = 4
17 MOD 4 = 1
If zero is specified as the right operand for either of these
division operators, the result is undefined.
Examples:
ADD R5, #-3 !A minus 3 is added to
register 5!
ADD R5, #K + (5*3) IValue of constant K + 15 is
added to register 5!
2-10
Note that expressions containing these operators are evaluated at
assembly time and, consequently, the arithmetic performed is
unsigned. Signed arithmetic can still be done at run time.
The effect of LAND, LOR, and LXOR can be seen from the following
examples. Although 32-bit arithmetic would actually be done by
the assembler, 8-bit arithmetic is shown for clarity. Assume two
constants A and B have the bit patterns 11110000 and 01010101,
respectively. The expressions:
A LAND B
A LOR B
A LXOR B
will result in the following evaluations of the operands:
LAND 11110000 LOR 11110000 LXOR 11110000
01010101 01010101 01010101
2-11
Shift Operators. The shift operators are as follows:
d operator n
where "d" is the data to be shifted and "n" specifies the number
of bits to be shifted. Vacated bits are replaced with zeros.
For example, if the constant PRODUCT is equal to 10110011, the
statement
LDB RLO, #(PRODUCT SHL 2)
2-12
The following lists the PLZ/ASM operators in order of precedence:
• Unary operators: +, -, LNOT
• Multiplication/Division/Shift/AND: *, / , MOD,
SHR, SHL, LAND
20/5 - 12/3 = 0
20/(5 - 12/3) = 20
Modes of Arithmetic Expressions. All arithmetic expressions have
a mode associated with them: absolute, relocatable, or external.
These modes are defined in detail in Section 4, following the
explanation of the concepts of "scope" and "program
relocatability".
2.3.5 Segmented Address Operators
Two special operators are provided to ease the manipulation of
segmented addresses. While addresses can be treated as a single
value with a symbolic name assigned by the programmer,
occasionally it is useful to determine the segment number or
offset associated with a symbolic name.
The "SEG" unary operator is applied to an address expression
which contains a symbolic name associated with an address, and
returns a 16-bit value. This value is the 7-bit segment number
associated with the expression and a one bit in the most
significant bit of the high-order byte, and all zero bits in the
low-order byte (Section 1.4.1).
2-13
Because of the special properties of these address operators, no
other operators may be applied to a subexpression containing a
SEG or OFFSET operator, although other operators can be used
within the subexpression SEG or OFFSET are applied to:
SEG (PTR+4) {Valid}
(SEG PTR)+4 {Invalid}
-(OFFSET PTR) {Invalid}
2-14
2.4.1 Immediate Data
2-15
LD RO, #DATATABLE + 1 2 !Add 12 to the address of
DATATABLE and load the result
into word register RO (non-
segmented mode) !
LDL RR2, IADDR ILoad the address of ADDR into
register pair RR2 (segmented
mode)!
LDL RR2, #<'<3»%1234 iLoad the segmented address
with segment 3, offset %1234
into register pair RR2 (seg-
mented mode)!
2-16
LD R5, #%3FFF ILoad register 5 with the
hexadecimal value 3FFF!
LDB RH3, #%F3 ILoad the high order byte of
word register 3 with the
hexadecimal value F3!
ADDL RR2, RR4 !Add the register pairs 2-3 and
4-5 and store the result in 2-3!
MULTL RQ8, RR12 IMultiply the value in register
pair 10-11 by the value in
register pair 12-13 and store the
result in register quadruple
8-9-10-11!
2-17
2.4.4 Direct Address
2-18
LD RIO, IDATUMI ILoad the contents of the
location addressed by DATUM
(short offset format) into
register 10!
LD «STORAGE»HEAD, RIO ILoad the contents of reg-
ister 10 into the location
addressed by the segment
named STORAGE offset by
HEAD (long offset format)!
JP |«3»%12| 'Jump to location addressed
by segment 3, offset %12
(short offset format)!
2-19
For those cases where a specific segment is desired, the
following notation may be used (the segment designator is
enclosed in double angle brackets):
«segment »of f set(R)
2-20
JR 0V, $+K !Add value of constant K to program
counter and jump to new location if
overflow has occurred!
In the second method, the assembler calculates the displacement
automatically. The programmer simply specifies an expression
which evaluates to a number or a program label as in Direct
Addressing. The address specified by the operand must be in the
valid range for the instruction, and the assembler automatically
subtracts the value of the address of the following instruction
to derive the actual displacement.
DJNZ R5, LOOP IDecrement register 5 and jump to
LOOP if the result is not zero!
LDR RIO, DATA ILoad the contents of the location
addressed by DATA into register 10!
2-21
2.4.8 Based Indexed Address
Based Indexed addressing is similar to Based addressing (2.4.7)
except that the displacement ("index") as well as the base is
held in a register. The contents of the registers are added
together to determine the address used in the instruction.
In nonsegmented mode, the base address is held in a word register
that is specified by an "R" followed by a number from 1 to 15.
The index is held in a word register specified in a similar
manner and enclosed in parentheses. Any general-purpose word
registers can be used for either the base or index except RO.
In segmented mode, the segmented base address is held in a
register pair that is specified by an "RR" followed by an even
number from 2 to 14. Any general-purpose register pair can be
used except RRO. The index is held in a word register that is
specified by an "R" followed by a number from 1 to 15. Any
general-purpose word register can be used except RO.
LD R3, R8(R15) ILoad the value at the location
addressed by adding the address
in R8 to the displacement in
R15 into register 3 (nonseg-
mented mode)!
LDB RR14(R4), RH2 ILoad register RH2 into the
location addressed by the seg-
mented address in RR14 indexed by
the value in R4 (segmented mode)!
2-22
Section 3
Assembly Language Instruction Set
3-1
LOAD AND EXCHANGE INSTRUCTIONS
ARITHMETIC INSTRUCTIONS
3-2
ARITHMETIC INSTRUCTIONS (continued)
LOGICAL INSTRUCTIONS
3-3
LOGICAL INSTRUCTIONS (continued)
3-4
BIT MANIPULATION INSTRUCTIONS (continued)
3-5
ROTATE AND SHIFT INSTRUCTIONS (continued)
3-6
BLOCK TRANSFER AND STRING MANIPULATION INSTRUCTIONS (continued)
INPUT/OUTPUT INSTRUCTIONS
3-7
INPUT/OUTPUT INSTRUCTIONS (continued)
3-8
INPUT/OUTPUT INSTRUCTIONS (continued)
3-9
The following set of instructions are privileged; that is, they
can only be executed in System mode:
3-10
3.2 NOTATION AND BINARY ENCODING
3-11
The control registers (CTLR) are:
FLAGS Status Flags
FCW Flags and Control Word
REFRESH Refresh
PSAP Program Status Area Pointer*
PSAPSEG Program Status Area Pointer Segment
PSAPOFF Program Status Area Pointer Offset
NSP Normal Stack Pointer*
NSPSEG Normal Stack Pointer Segment
NSPOFF Normal Stack Pointer Offset
For the nonsegmented Z8002, PSAP is equivalent to PSAPOFF
and NSP is equivalent to NSPOFF.
VI Vectored Interrupt
NVI Non-Vectored Interrupt
The binary values used in the instruction format encoding for the
general-purpose registers are:
Register Binary
RQO RRO RO RHO 0000
Rl RH1 0001
RR2 R2 RH2 0010
R3 RH3 0011
RQ4 RR4 R4 RH4 0100
R5 RH5 0101
3-12
Register Binary
RR6 R6 RH6 0110
R7 RH7 0111
RQ8 RR8 R8 RLO 1000
R9 RL1 1001
RR10 RIO RL2 1010
Rll RL3 1011
RQ12 RR12 R12 RL4 1100
R13 RL5 1101
RR14 R14 RL6 1110
R15 RL7 1111
The condition codes and the flag settings they represent are:
3-13
3.2.2 Instruction Format Encoding
The binary encoding of each Z8000 instruction follows one of nine
basic formats. Each format determines the grouping of bits into
various instruction "fields", the meaning of which depends on the
instruction. The following symbols represent these fields:
3-14
The standard formats for address information are illustrated by
the following examples. Nonstandard formats are described in the
detailed description for each instruction (Section 3.3). The
following examples use Addition (ADD), Load (LD), and Load
Relative (LDR) instructions for illustration purposes, although
the address information formats apply to all instructions which
require additional address information.
Register (R)
dst src
ADD R, R mode opcode W/B src dst I
-i 1 1 1
{mode = 10}
Example:
ADD R2,R3 1 0 0 0 0 0 0 0 0 1 1 0 0
3-15
Immediate Data — Long (IM)
dst src
ADDL R, IM mode opcode src dst
i i i i i i i i i i i i
data (high order)
i i i i i i i i i i i i i
data (low order)
i i i i i i i i i i i i i i
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
1 1 I I 1 1 1 1 I I I I I I
0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0
I 1 1 1 1 1 1 I
3-16
Direct Address — Segmented Short Offset (DA)
dst src
ADD R, DA mode opcode W/B src dst
i i i i
o segment off set
i i i i i 1 1 1
Example:
ADD R2, | «3»%0012| 0 1 0
I
0
I
0
I
0
I
0 1 0
I
0
I
0
t
0 0 0 1 0
0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0
1 1 1
dst src
ADD R, DA mode
i
opcode
i i i
W/B
i
src
i i i
dst
i i
1 segment 0 0 0 0 0 0 0 0
i i i i i 1 1 1 1 1 1 1
offset
Example:
ADD R2,«3»%0012 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0
I I I I ! 1 1 I I I
1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
I I I I 1 1 1 I I I
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
I 1 I I 1 I I 1 I I I !
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
I I I I I I I I I I I
3-17
Indexed Address — Segmented Short Offset (X)
dst src
ADD R, X mode
i
opcode
i i i
W/B
i
src
t i
dst
0 segment offset
0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0
Example:
ADD R2,«3»%0012(R4) 0 1 0
I
0
I
0
I
0
I
0 1 0
I
1
I
0
I
0 0 0 1 0
1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
I I I 1 1 1 1 I I I
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
Example:
LDR R2,$+10 0
l
0
l
1
l
1
I
0
I
0
l
0 1 0
L
0
i
0
I
0
l
0
J_.
0
_J
1
l
0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
l I I l I I l l l 1 1 l l l J
3-18
Based Address (BA)
Examole:
^LD R2,R4(#%0012) 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0
I I I I I I
0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
I I I
dst src
LD R, BX I I
opcocJe
I I I
W/B
I
src
I I 1
dst
1 I
0 0 0 0 0 0 0 0 0 0 0 0
I I I I I I 1 1 1
Example:
LD R2,R4(R5) 0 1 1 1 0 0 0 1 0 1 0 0 0 0 1 0
I I I I t I I I I I I
0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0
I I I I I I
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
1 1 1 1 1 1 I I 1 1 I
3-19
E3-3055-01 07/02/79
The nine basic formats, Fl through F9, determine the size of the
instruction, which also depends on the addressing mode. The
following table can be used to determine the number of bytes in a
particular instruction. The addressing mode (including the data
operand size and whether segmented or nonsegmented mode is used)
specifies the row in the table, while the format number specifies
the column.
R, IR 2 2 4 4 2 2 —
IM (Word/Byte) 4 4 2 -- -- -- 2
IM (Long) c.
D
C
D
DA,X (NS/SS) 4 4 — -- 6 6 4 — —
DA,X (SL) 6 6 ~ — 8 8 — — —
RA — -- 2 4
BA 4
BX 4
NS = N o n s e g m e n t e d , SS = Segmented S h o r t O f f s e t , SL = Segmented
Long O f f s e t
3^20
E3-3055-01 07/02/79
3.2.3 Operation Notation
Symbol Meaning
src Source operand
dst Destination operand
r Register operand (typically
used as a counter)
num Number, that is, an immediate
value
cc Condition code
instruction Binary value of the instruction
itself
Rn Register number "n"
PC Program Counter register
PS Program Status register
SP Processor stack pointer register
(R15 if nonsegmented, RR14
if segmented)
Becomes (assignment of a value)
@n Indirect; that is, the value
found at the address contained
3-21
Symbol Meaning
3-22
3.3 ASSEMBLY LANGUAGE INSTRUCTIONS
3-23
3-24
ADC
Add with Carry
3-25
ADD
Add
3-26
AND
And
3-27
BIT
Bit Test
3-28
BIT
Bit Test
NOTE: Only the lower four bits of the source operand are used
to specify the bit number for BIT, while only the lower
three bits of the source operand are used with BITB.
When the source operand is an immediate value, the "src
field" in the instruction format encoding contains the
bit number in the lowest four bits for BIT, or the
lowest three bits for BITB.
EXAMPLE: If register RH2 contains %B2 (10110010), the statement
BITB RH2,#0
will leave the Z flag set.
3-29
CALL
Call Procedure
3-30
CALR
Call Procedure Relative
3-31
CLR
Clear
3-32
COM
Complement
3-33
COMFLG
Complement Flag
CYCLES:
EXAMPLE: If the C, Z, and S flags are all clear (=0),
and the P flag is set (=1), the statement
COMFLG P, S, Z, C
will leave the C, Z, and S flags set (=1),
and the P flag cleared (=0).
3-34
CP
Compare
CP d s t , src dst: R , I R , DA , x
CPB sr c : R , I M , IR , DA, X
CPL
INSTRUCTION FORMAT: (F2.1)
mode dst src
W/B : mode 0 0 1 0 1 W IB src dst 10 R R
i i i i l l r, n
00 R IM (src f ield=0)
L : mode 0i 1i 0 i 0 i0 i D 1 src
1 1 dst 0 0 R IR (src f ieldOO)
l ' ' i .- ni R DA (src f ield=0)
01 R X (src f ieldOO)
(F5.1)
mode dst src
mode
W/B : o o i i o w; B dst
i i i
0 0 0 1
i i i
00 IR IM
Ul DA IM ( d s t f i e l d = 0 )
01 X IM ( d s t f i e l d O O )
3-35
E3-3055-01 07/02/79
CP
Compare
3-36
CPD
Compare and Decrement
CYCLES: Word/Byte
20
3-37
CPDR
Compare, Decrement and Repeat
CYCLES: Word/Byte
ll+9*n (n=number of data elements compared)
3-38
CPDR
Compare, Decrement and Repeat
CPDR R3,@R2,R8,GT
will leave the Z flag set indicating the condition was
met. Register R2 will contain the value %200ü, R3 will
still contain 3, and R8 will contain 4.
3-39
CPI
Compare and Increment
CYCLES: Word/Byte
20
EXAMPLE: This instruction is used in a "loop" of instructions
which searches a string of data for an element meeting
the specified condition, but an intermediate operation
on each data element is required. The following se-
quence "scans while numeric", that is, a string is
searched until either an ASCII character not in the
3-40
CPI
Compare and Increment
3-41
CPIR
Compare, Increment and Repeat
CPIR d s t , s r c , r , c c dst: R
CPIRB src: IR
INSTRUCTION FORMAT: (F6.5)
dst src £
W/B: 1
I
0
I
1
I
1 1
I
0
I
1 VW B
i
src
i i
0
l
1
l
0
l
0 R IR R
0 0 0 0 r dst cc
i i i i i i 1 1 1
CYCLES: Word/Byte
ll+9*n (n=number of data elements compared)
NOTE: This instruction can be interrupted after each
execution of the basic operation. The program counter
value of the start of this instruction is saved
3-42
CPIR
Compare, Increment and Repeat
LD Rl,tSTRSTART
LD R3,#STRLEN
LD RLO,#'%R'
CPIRB RLO,@R1,R3,EQ
JR Z,FOUND
3-43
CPSD
Compare String and Decrement
CYCLES: Word/Byte
25
EXAMPLE: If register R2 contains %2000, the byte at location
%2000 contains %FF, register R3 contains %3000, the
byte at location %3000 contains %00, and register R4
contains 1, the statement
3-44
CPSD
Compare String and Decrement
CPSDB @R2,@R3,R4,UGE
will leave the Z flag set since the condition code would
have been "unsigned greater than or equal", and the V
flag will be set to indicate that the counter R4
now contains 0. R2 will contain %1FFF, and R3 will
contain %2FFF.
3-45
CPSDR
Compare String, Decrement and Repeat
3-46
CPSDR
Compare String, Decrement and Repeat
3-47
CPSI
Compare String and Increment
CPSI d s t , s r c , r , c c dst: IR
CPSIB src: IR
3-48
CPSI
Compare String and Increment
3-49
CPSIR
Compare String, Increment and Repeat
3-50
CPSIR
Compare String, Increment and Repeat
3-51
DAB
Decimal Adjust
Decimal Adjust
DAB dst dst: R
3-52
DAB
Decimal Adjust
3-53
DEC
Decrement
3-54
DI
Disable Interrupt
1 0
l
1
l
1
l
1
l
1
l
1
l
0
l
0 0
1
0
1
0
1
0
1
0
1
0 V| NV||
CYCLES: 7
NOTE: This is a privileged instruction.
EXAMPLE: If both the NVI and VI control bits are
set (=1), the statement
DI VI
3-55
E3-3055-01 07/02/79
piv
Divide
OPERATION: Word
d s t , d s t v l <- d s t , d s t v l src
{dst <- r e m a i n d e r
dstyl <- q u o t i e n t }
R 13 — 30
IM 13 — — 30 -- --
IR 13 30 — —
DA 14 —
15 —
17 31 32 34
X 15 15 18 32 32 35
(Absolute value of the high-order half of the
div idend is larger than the absolute value of
the divisor)
R 25 — 51 —
IM 25 -- — 51 —
-- --
IR —
25 51 —
DA 26 —
27 —
28 52 —
53 55
X 27 27 29 53 53 56
NOTE: For proper instruction execution, the "dst field" in
the instruction format encoding must be even for DIV,
and must be a multiple of 4 (0,4,8,12) for DIVL. If
the source operand in DIVL is a register, the "src
field" must be even.
DIV RRO,R3
3-57
DJNZ
Decrement and Jump if Not Zero
OPERATION: r <- r - l
if r O 0 then PC <- PC - (2*disp)
CYCLES: Word/Byte
11
3-58
Decrement and
DJNZ
Jump if Not Zero
3 59
EI
Enable Interrupt
CYCLES: 7
El NVI,VI
3-60
E3-3055-01 07/02/79
EX
Exchange
EX dst,src dst: R
EXB src: R, IR , DA , x
INSTRUCTION FORMAT: ( F2.1)
mode dst src
W/B : 1 mode 1 0 1 1 o W;B src dst 10 R R
l i i i i i i i i i i un un R IR
01 R DA (src field=
01 R X (src field<
3-61
EXTS
Extend Sign
W: mode 1 1 0 0 0 1 dst 1 0 1 0
i 1 1 1 I 1 I
L: mode 1 1 0 0 0 1 dst 0 1 1 ll
I I 1 I 1
OPERATION: Byte
if dst(7)=0 then dst(8:15) <- 000...000
else dst(8:15) <- 111...Ill
Word
if dstvl(15)=0 then dst(16:31) <- 000...000
else dst(16:31) <- 111...Ill
Long
if dstv2,dstv3(31)=0 then dst,dstwl(32:63) <- 000...000
else dst,dstvK32:63) <- 111...Ill
The sign bit of the low-order half of the destination
operand is copied into all bit positions of the high-order
half of the destination. For EXTSB, the destination is a
word register; for EXTS, the destination is a register
pair; for EXTSL, the destination is a register quadruple.
This instruction is useful in multiple precision arith-
metic or for conversion of small signed operands to
larger signed operands.
FLAGS: No flags affected
CYCLES: Word/Byte Long
11
NOTE: For proper instruction execution, the "dst field" in
the instruction format encoding must be even for EXTS,
and must be a multiple of 4 (0,4,8,12) for EXTSL.
EXAMPLE: If register pair RR2 (composed of word registers R2
and R3) contains %12345678, the statement
EXTS RR2
HALT
0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0
1 1 I I I i I
OPERATION:
3-63
IN
Input
IN dst,src dst: R
INB src: IR, DA
INSTRUCTION FORMAT: (F7.3)
ds t sr c
W/B: o o i i i i o W/B dst R IR
(F7.1)
dst src
W/B: 0 1 1 1 0 1 W/B dst 0 1 0 0 R DA
OPERATION: dst <- src
The contents of the source operand are loaded into the
destination. I/O addresses are always 16 bits.
FLAGS: No flags affected
CYCLES: src Word/Byte
IR 10
DA 12
NOTE: This is a privileged instruction.
EXAMPLE: If register R6 contains the I/O address %0123, and the
"port" %0123 contains %FF, the statement
INB RH2,@R6
will leave the value %FF in register RH2.
3-64
INC
Increment
3-65
IND
Input and Decrement
IND @RR4,@R6,RO
will leave the value %05B9 in location %02004000, the
value %02003FFE in RR4, and the value %0015 in RO.
Register R6 still contains the value %0228.
3-66
INDR
Input, Decrement and Repeat
INDR d s t , s r c , r dst: IR
INDRB src: IR
INSTRUCTION FORMAT: (F6.4)
dst src r
W/B: 0
1
0
1
1
1
1 1
I
0
I
1 W/B
i
src
i i
1
I
0
I
0
I
0 IR IR R
0 0 0 0 r dst 0 0 0 0
1 1 1 i i i i i i I t I
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
This instruction can be interrupted after each execution
of the basic operation. The program counter value of
the start of this instruction is saved before the in-
terrupt request is accepted, so that the instruction can
be properly resumed. Seven more cycles should be added to
this instruction's execution time for each interrupt
request that is accepted.
3-67
INDR
Input, Decrement and Repeat
3-68
INI
Input and Increment
3-69
INIR
Input, Increment and Repeat
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
This instruction can be interrupted after each execution
of the basic operation. The program counter value of
the start of this instruction is saved before the in-
terrupt request is accepted, so that the instruction can
be properly resumed. Seven more cycles should be added
to this instruction's execution time for each interrupt
request that is accepted.
3-70
INIR
Input, Increment and Repeat
INIRB @R1,@R2,R3
3-71
IRET
Interrupt Return
IRET
OPERATION: N o n s e g me n t e d Segmented
SP <- SP + 2 SP <- SP + 2 {Pop "identifier"}
PS <- @SP PS <- @SP
SP <- SP + 4 SP <- SP + 6
This instruction is used to return to a previously
executing procedure at the end of a procedure entered
by an interrupt or trap (including a System Call
instruction). First, the "identifier" word associated
with the interrupt or trap is popped from the system
processor stack and discarded. Then contents of the
the location addressed by the system processor stack
pointer are popped into the program status (PS), loading
the Flags and Control Word (FCW) and the program
counter (PC). The new value of the FCW is not effective
until the next instruction, so that the status pins will
not be affected by the new control bits until after the
IRET instruction execution is completed. The next in-
struction executed is that addressed by the new contents
of the PC. The system stack pointer (R15 if nonsegmented,
or RR14 if segmented) is used.
FLAGS C Loaded from processor stack
Z Loaded from processor stack
S Loaded from processor stack
P/V Loaded from processor stack
D Loaded from processor
H: Loaded from processor stack
CYCLES: Address
NS SS "SL
13 -- 16
NOTES: This is a privileged instruction.
3-72
IRET
Interrupt Return
3-73
IP
Jump
3-74
JR
Jump Relative
JR cc,dst dst: RA
3-75
JR
Jump Relative
3-76
LD
Load
*See Note
(F4.4)
src d ;t
dst src
0 0 1 1 0 0 0 W / B
W/B: l i l l i i i i i i i R BA (src fieldOO)
displacement
i i i i i i i i i i i i l i
L: 0 0 1 1 0 1 0 1 src dst
l l l l l l l _i i i i i
displacement
(F4.3)
dst src
W/B: 0 1 1 1 0 0 0 W/B src dst R BX (src fieldOO)
1 1 1 I I 1 1 1 1 1 1
0 0 0 0 X 0 0 0 0 0 0 0 0
L: 0 1 1 1 0 1 0 1 src dst
I I I I I 1 1 1 1 1 1
0 0 0 0 X 0 0 0 0 0 0 0 0
1 1 1
(F2.2)
mode dst src
W/B: mode 1 0 1 1 1 W/ B dst src 00 IR R
01 DA R (dst field=0)
L: mode 0 1 1 1 0 1 dst
i
src
i i
01 X R (dst fieldOO)
(F5.1)
mode
mode dst src
0 0 1 1 0 W/B dst
W/B: 0
1
1
1
0
1
1
00 IR IM
01 DA IM ( d s t f i e l d = 0 )
01 X IM ( d s t f i e l d O O )
3-77
E3-3055-01 07/02/79
LD
Load
(F4.2)
ds t sre
0 0 1 W / Bdst s re
W/B: l l >
1
i
0
i
0
i
1
i i i i i i BA R (dst fieldOO)
displacement
l l l i i i i i i i i i i t i
L: 0
l
0
l
1
l
1
i
0
i
1
i
1
i
1
i
dst
i i i
s re
i i
displacement
l l l i i i t i i i i i i i i
(F4.1)
dst src
W/B: 0 1 1 1 0 0 1 W/B dst src
I I 1 I I I 1 1 i i i BX R (dst fieldOO)
0 0 0 0 X 0 0 0 0 0 0 0 0
L: 0 1 1 1 0 1 1 1 dst src
I I I I I i i i 1 1 1
0 0 0 0 X 0 0 0 0 0 0 0 0
3-78
LD
Load
3-79
LDA
Load Address
(F4.3)
dst src
0 1 1 1 0 1 0 0 src dst R BX (src fieldOO)
I I I I I I i i i i i i
0 0 0 0 X 0 0 0 0 0 0 0 0
I ' '
3-80
LDAR
Load Address Relative
3-81
LDCTL
Load Control Register
:F8.2)
dst src
1 0 0 0 1 1 0 0 dst 0 0 0 1
R CTLR
LDCTLB R,FLAGS
dst(2:7) <- FLAGS(2:7)
dst(0:l) <- 0
FLAGS: c z s P/V D H
, (
i i j1 J j i i '
R: i i i i i 0 0
LDCTLB R,FLAGS
No flags affected
3-82
LDCTL
Load Control Register
CYCLES: 7
3-83
LDCTL
Load Control Register
(F8.2)
dst src
W: 0 , 1 , 1 , 1 I
1
I
1
I
0
1
1 dst
i i i
o
i
o 1 o R CTLR
LDCTL R,FCW
dst(2:7) <- FCW(2:7)
dst(ll:15) <- FCW(11:15)
dst(0:l) <- 0
dst(8:10) <- 0
R:f
i | j i i 0
1
0
1
0
1 1 1 1 1
0
1
0
LDCTL R,FCW
No flags affected
3-84
LDCTL
Load Control Register
CYCLES: 7
3-85
LDCTL
Load Control Register
LDCTL R,REFRESH
dst(l:8) <- REFRESH(1:8)
dst(O) <- 0
dst(9:15) <- undefined
1 I J _l J i i i i t i
CYCLES: 7
NOTE: This is a privileged instruction.
LDCTL REFRESH,RO
(F8.2)
dst src
W: o 1i1 i1 i 1i 1i0 i1 dst 1 0 0 R CTLR
LDCTL R,PSAPSEG
dst(8:14) <- PSAPSEG(8:14)
dst(0:7) <- 0
dst(15) <- 0
The contents of the PSAPSEG register are loaded
into the destination (a word register). Bits 0, 1,
2,...,7, and 15 of the destination register are
cleared to zero. The PSAPSEG register is
unaffected.
15 14 13 12 11 10 9 8 7 6 5 4
SEGMENT NUMBER
PSAPSEG: R[
| o|
r 0 0 0
CYCLES; 7
3-87
LDCTL
Load Control Register
3-6
LDCTL
Load Control Register
(F8.2)
dst src
dst R CTLR
LDCTL R,PSAPOFF
dst(8:15) <- PSAPOFF(8:15)
dst(0:7) <- 0
The contents of the PSAPOFF register are loaded
into the destination (a word register). Bits 0, 1,
2,...,7 of the destination register are cleared to
zero. The PSAPOFF register is unaffected.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
UPPER OFFSET
i i i i i i i i l t i t i i
j L 1 1k , 1 , l l ;
R: i i i i i i i
0 0 0 0 0 0 0 0
CYCLES: 7
NOTES: This is a privileged instruction.
In the nonsegmented Z8002 version, the mnemonic
"PSAP" should be used in the assembly language
statement, and indicates the same control register
as the mnemonic "PSAPOFF".
In the segmented Z8001 version, care must be
exercised when changing the two PSAP register
values so that an interrupt occurring between the
changing of PSAPSEG and PSAPOFF is handled
correctly.
3-89
LDCTL
Load Control Register
3-90
LDCTL
Load Control Register
LDCTL R,NSPSEG
dst <- NSPSEG
NSPSEG: I 1 [ 1
,
R: ! I (
1 1 1 1 ! ! ! 1 ! 1 ( ,
3-91
LDCTL
Load Control Register
(F8.2)
dst src
W: o i i i i i o i dst 0 1 1 1 R CTLR
LDCTL R,NSPOFF
dst <- NSPOFF
NSPOFF:
Ji ,i i , i j i J l i i I 1 t k l 1 1l l
R: , l (
i , , , ( , , ,
CYCLES: 7
NOTES: This is a privileged instruction.
3-92
LDD
Load and Decrement
CYCLES: Word/Byte
20
3-93
LDDR
Load, Decrement and Repeat
CYCLES: Word/Byte
ll+9*n (n=number of data elements transferred)
3-94
LDDR
Load, Decrement and Repeat
3-95
LDI
Load and Increment
CYCLES: Word/Byte
20
EXAMPLE: This instruction is used in a "loop" of instructions
which transfers a string of data from one location to
another, but an intermediate operation on each data
element is required. The following sequence transfers a
string of 80 bytes, but tests for a special value (%OD,
an ASCII return character) which terminates the loop if
found:
LD R3,#80 [Initialize counter!
LD R1,#DSTBUF ILoad start addresses!
LD R2,#SRCBUF
LOOP:
CPB @R2,#%OD ICheck for return character!
JR EQ,DONE !Exit loop if found!
LDIB @R1,@R2,R3 !Transfer next byte!
JR NOV,LOOP IRepeat until counter=0!
DONE:
3-96
LDIR
Load, Increment and Repeat
LDIR d s t , s r c , r dst: IR
LDIRB src: IR
INSTRUCTION FORMAT: (F6.4)
dst src r
W/B: 1 0 1 1 1 0 1 W/B src 0 0 0 1 IR IR R
I I I I I i i i I I I
0 0 0 0 r dst 0 0 0 0
I 1 1 l l l i i i 1 1 1
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
ll+9*n (n=number of data elements transferred)
3-97
LDIR
Load, Increment and Repeat
3-98
LDK
Load Constant
3-99
LDM
Load Multiple
Me mo r y from Reg is t e r s
dst <- Rsrc,Rsrc+num-l
The contents of num word registers including the source
register and the following (num-1) registers are loaded
into the destination words. The contents of the source(s)
are not affected. The value of num can vary from 1 to 16,
and the registers are loaded in increasing order, with RO
following R15.
FLAGS: No flags affected
CYCLES; dst src Word
NS SS SL
R IR ll+3*n — — (n=number of registers)
R DA 14+3*n 15+3*n 17+3*n
R X 15+3*n 15+3*n 18+3*n
IR R ll+3*n —
DA 14+3*n —
15+3*n
R 17+3*n
X R 15+3*n 15+3*n 18+3*n
NOTES: The "num field" in the instruction format encoding contains
the "num operand. The "num field" values range from 0 to 15
corresponding to the num values 1 to 16.
3-100
LDM
Load Multiple
3-101
LDPS
Load Program Status
NONSEGMENTED SEGMENTED
LOW ADDRESS
FCW
PC
HIGH ADDRESS
3-102
LDPS
Load Program Status
3-103
LDR
Load Relative
LDR dst,src d s t: R, RA
LDRB src: R, RA
LDRL
L: 0 0 1 1 0 1 0 1 0 0 0 0 dst
I 1 I I I I I 1 1 1 1 1 1
displacement
1 1 i i i i i i i i i i i i i
(F4.2)
dst src
0 0 1 1 0 0 1 W / o
B o o o src RA R
W/B: i i i i i 1 1 1 i i i
displacement
L: 0 0 1 1 0 1 1 1 0 0 0 0 src
1 I I I I I
displacement
3-104
MBIT
Multi-Micro Bit Test
MBIT
0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 0
I I I I I I I
FLAGS: C: Unaffected
Z: Undefined
S: Set if ul is zero; cleared otherwise
V: Unaffected
D: Unaffected
H: Unaffected
CYCLES:
3-105
MREQ
Multi-Micro Request
OPERATION: Z <-
if p = 1 then S_<- 0
pO <- 0
else pO <- 1
repeat dst <- dst - 1
pntjil dst = 0
if pi = 1 then S <- 1
else §_<- 0
pO <- 0
Z <- 1
3-106
MREQ
Multi-Micro Request
1 1 1 Request granted
(resource available)
FLAGS: C Unaffected
Z Set if request was signalled; cleared otherwise
S: Set if request was signalled and granted;
cleared otherwise
V: Unaffected
D Unaffected
H: Unaffected
CYCLES: 12 (request not signalled)
12+7*n (request signalled, n=number
of times destination is decremented)
NOTE: This is a privileged instruction.
EXAMPLE : TRY :
LD R0,#50 lAllow for propagation delay!
MREQ RO IMulti-micro request with
delay in register RO!
JR MI,AVAILABLE
JR Z,NOT GRANTED
NOT AVAILABLE: IResource not available!
3-107
MRES
Multi-Micro Reset
MRES
OPERATION: pO <- 0
This instruction is used to synchronize multiple
processors' exclusive access to shared hardware
resources. The multi-micro output pin (uO) is
cleared to zero (inactive state = high voltage).
Resetting jöö to zero is used to indicate that a
resource controlled by the CPU is available for use
by other processors.
FLAGS: No flags affected
CYCLES: 5
NOTE: This is a privileged instruction.
EXAMPLE: MRES ISignal that resource controlled
by this CPU is available to
other processors!
3-108
MSET
Multi-Micro Set
MSET
0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 0
I I I I I I I i 1 1 I 1 I I
OPERATION: uO <- 1
CYCLES: 5
NOTE: This is a privileged instruction.
3-109
MULT
Multiply
OPERATION: Word
dst,dstvl <- src
Long
dst ,dst\/l i dst\/2 ,dst\/3 <- dst\/2,dst\/3 * src,srcyl
3-110
MULT
Multiply
IR 70 282+7*n — 286+7*n
DA 71 72 74 283+7*n 284+7*n
X 72 72 75 284+7*n 284+7*n 287+7*n
(n=number of bits equal to
one in the absolute value of
the low-order 16 bits of
the destination operand)
(Multiplier is zero)
R 18 30
IM 18 30
IR 18 30
DA 19 20 22 31 32 34
X 20 20 22 32 32 35
3-111
NEC
Negate
3-112
NOP
No Operation
NOP
OPERATION:
3-113
OR
Or
OR dst,src dst: R
ORB src: R, IM, IR, DA, X
3-114
OTDR
Output, Decrement and Repeat
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
This instruction can be interrupted after each
execution of the basic operation. The program
counter value of the start of this instruction is
saved before the interrupt request is accepted, so
that the instruction can be properly resumed.
Seven more cycles should be added to this
instruction's execution time for each interrupt
request that is accepted.
3-115
OTDR
Output, Decrement and Repeat
OTDR @R11,@R12,R13
3-116
OTIR
Output, Increment and Repeat
OTIR d s t , s r c , r dst: IR
OTIRB src: IR
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
This instruction can be interrupted after each
execution of the basic operation. The program
counter value of the start of this instruction is
saved before the interrupt request is accepted, so
that the instruction can be properly resumed.
Seven more cycles should be added to this
instruction's execution time for each interrupt
request that is accepted.
3-117
OTIR
Output, Increment and Repeat
3-118
OUT
Output
(F7.2)
dst src
W/B: W/B 0 1 1 0 DA
OUT %1120,R6
3-119
OUTD
Output and Decrement
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set if the result of decrementing r is zero;
cleared otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
21
NOTE: This is a privileged instruction.
3-120
OUTI
Output and Increment
OUTI d s t , s r c , r dst: IR
OUTIB src: IR
CYCLES: Word/Byte
21
3-121
Qndnnl
LD R1,#PORT !Load I/O address!
LD R2,tSRCSTART ILoad start of string!
LD R3,#80 Unitialize counter!
LOOP:
TESTB @R2 ITest byte parity!
JR PE,EVEN
SETB (§R2,#7 IForce even parity!
EVEN:
OUTIB @R1,@R2,R3 !0utput next byte!
JR NO V, LOOP IRepeat until counter=0!
DONE:
POP
Pop
3-123
E3-3055-01 07/02/79
PUSH
Push
PUSH d s t , s r c dst: IR
PUSHL src: R, IM, IR, DA, X
E3-3055-01 07/02/79
RES
Reset Bit
W/B: 0
I
0
I
1
I
0 0
I
0
I
1 W/B 0
I
0
I
0
I
0
I
src
I I
0 0 0 0 dst 0 0 0 0 0 0 0 0
1 1 1 I I I I I I I I
CYCLES:
RESFLG C, V
3-126
RET
Return from Procedure
RET cc
CYCLES: Address
NS SS SL
10 — 13 (return is taken)
7 — 7 (return not taken!
3-127
RL
Rotate Left
RL dst,src dst: R
RLE s r c: IM
AUCTION FORMAT: (Fl.l)
mode dst src
mode 1
I
1
I
0
I
0
I
1 W/B dst 0
I
0
1
S
1
0 10 R TM~
(Perform operation once if s=0, twice if s=l)
OPERATION: C <- dst(msb)
dst(O) <- dst(msb)
dst(n+l) <- dst(n) {n is 0 to msb-1
The contents of the destination operand are rotated left
one bit position if the source operand is 1, or two bit
positions if the source operand is 2. The source operand
may be omitted from the assembly language statement and
thus defaults to the value 1. The most significant bit
of the destination operand is moved to the bit 0 position
and also replaces the C flag.
Word:
Byte: [c~\-
FLAGS: C: Set if the last bit rotated from the most significant
bit position was 1; cleared otherwise
Z: Set if the result is zero; cleared otherwise
S: Set if the most significant bit of the result is set;
cleared otherwise
V: Set if arithmetic overflow occurs, that is, if the
sign of the destination changed during rotation; cleared
otherwise
D: Unaffected
H: Unaffected
:YCLES: Word/Byte
6 (once)
7 (twice)
EXAMPLE If register RH5 contains %88 (lOOÜlOOO; the statement
RLB RH5
will leave the value %11 (00010001! in RH5 and the
carry flag will be set to one.
3-128
E3-3055-01 07/02/79
RLC
Rotate Left through Carry
Word:
Byte:
FLAGS: Set if the last bit rotated from the most significant
bit position was 1; cleared otherwise
Z: Set if the result is zero; cleared otherwise
S: Set if the most significant bit of the result is set;
cleared otherwise
V: Set if arithmetic overflow occurs, that is, if the
sign of the destination changed during rotation; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
6 (once)
7 (twice!
EXAMPLE: If the carry flag is clear (=0) and register RO
contains %800F (1000000000001111), the statement
RLC R0,#2
w i l l leave t h e v a l u e % U 0 3 D ( O O O O O O G O G 0 1 1 1 1 0 1 ) in
RO a n d c l e a r t h e c a r r y f l a g .
E3-3055-01 3 129 07/02/79
RLDB
Rotate Left Digit
OPERATION: s r c ( 0 : 3 ) <- d s t ( 0 : 3 )
src(4:7) <- src(u:3)
dst(0:3) <- src(4:7)
7 4 3 0 7 4 3 |- 0
dst I I
src
i L
FLAGS Unaffected
Set if the result is zero; cleared otherwise
Set if the most significant bit of the result is set;
cleared otherwise
Unaffected
Unaffected
Unaffected
CYCLES:
NOTE: The same register must not be used in both the source
and destination addressing mode designators.
3 130
RLDB
Rotate Left Digit
3-131
RR
Rotate Right
RR dst,src dst: R
RRB src: IM
15
Wo r d:
Byte:
FLAGS: C Set if the last bit rotated from the least significant
bit position was 1; cleared otherwise
Set if the result is zero; cleared otherwise
Set if the most significant bit of the result is set;
cleared otherwise
V: Set if arithmetic overflow occurs, that is, if the
sign of the destination changed during rotation; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
6 (once)
7 (twice)
EXAMPLE If register RL6 contains %31 (00110001), the statement
RRB RL6
will leave the value %9Q (10011000) in RL6 and the
carry flag will be set to one.
3 132
E3-3055-01 07/02/79
RRC
Rotate Right through Carry
15
Word:
Byte:
FLAGS: C: Set if the last bit rotated from the least significant
bit position was 1; cleared otherwise
Z: Set if the result is zero; cleared otherwise
S: Set if the most significant bit of the result is set;
cleared otherwise
V: Set if arithmetic overflow occurs, that is, if the
sign of the destination changed during rotation; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
6 (once)
7 (twice)
3-133
E3-3055-01 07/02/79
RRC
Rotate Right through Carry
3-134
RRDB
Rotate Right Digit
7 4 3 4 3 i 0
' 1
dst src
t
FLAGS: C: Unaffected
Z: Set if the result is zero; cleared otherwise
S: Set if the most significant bit of the result is set;
cleared otherwise
V: Unaffected
D: Unaffected
H: Unaffected
CYCLES: Byte
Bjte
NOTE: The same register must not be used in both the source
and destination addressing mode designators.
3-135
RRDB
Rotate Right Digit
3-136
SBC
Subtract with Carry
I mode
l
1 1 0 1 1 W/B
i
src
i i l
dst
l I I
3-137
sc
System Call
sc src src: IM
NONSEGMENTED SEGMENTED
LOW ADDRESS
SP SP INSTRUCTION
INSTRUCTION
AFTER" AFTER"
FCW FCW
PC SEG NO
SP PC OFFSET
BEFORE
SP
BEFORE
HIGH ADDRESS
3-138
sc
System Call
3-139
SDA
Shift Dynamic Arithmetic
L: mode 1 1 0 0 1 1 dst 1 1 1 1
i I 1 1 i i i 1 1
0 0 0 0 src 0 0 0 0 0 0 0 0
i i i 1 1 1 1 1 1
Byte:
Word
15
Long Rn
15 0
.1 Rn -I- 1
n=0,2,4,...,14 n=0,2,4,...,14
3-140
SDA
Shift Dynamic Arithmetic
3-141
SDL
Shift Dynamic Logical
L: mode 1 1 0 0 1 1 dst 0 1 1 1
i I I I i i i I I I
0 0 0 0 src 0 0 0 0 0 0 0 0
i I i i 1 1 1 I I I
3-142
SDL
Shift Dynamic Logical
Right Left
Byte:
15
Word: o-
15
Long : °—*~\_ Rn Rn
Rn + 1
>-'
n=0,2,4, . . . ,14 n=0 , 2 , 4 , . . . ,14
FLAGS Set if the last bit shifted from the destination was 1;
cleared otherwise
Set if the result is zero; cleared otherwise
Set if the most significant bit of the result is set;
cleared otherwise
Undefined
Unaffected
Unaffected
SDLB RL5,R1
3-143
SET
Set Bit
3-144
SETFLG
Set Flag
CYCLES:
EXAMPLE: If the C, Z, and S flags are all clear (=0),
and the P flag is set (=1), the statement
SETFLG C
will leave the C and P flags set (=1), and
the Z and S flags cleared (=0).
3-145
SIN
Special Input
3-146
SIND
Special Input and Decrement
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set if the result of decrementing r is zero;
cleared otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
~"
NOTES: This is a privileged instruction.
The status pins indicate a special I/O reference.
3-147
SINDR
Special Input, Decrement and Repeat
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
The status pins indicate a special I/O reference.
3-149
SINIR
Special Input, Increment and Repeat
CYCLES; Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
3-150
SLA
Shift Left Arithmetic
L: mode 1 1 0 0 1 1 dst 1 1 0 1
1 I I I i i i I I I
src
i i i i i i i i i i i i t i i
Byte: c
15
Word:
Long: Rn
Rn
n=0,2,4,...,14
3-151
SLA
Shift Left Arithmetic
FLAGS: Set if the last bit shifted from the destination was 1;
cleared otherwise
Z: Set if the result is zero; cleared otherwise
S: Set if the result is negative; cleared otherwise
V: Set if arithmetic overflow occurs, that is, if the
sign of the destination changed during shifting; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Word/Byte Long
13+3*n 13+3*n (n=number of bit positions,
where 0 is equivalent to 1)
NOTE: The "src field" is encoded in the instruction format as
the 16-bit two's complement positive value of the source
operand. For each operand size, the operation is undefined
if the source operand is not in the range specified above.
EXAMPLE: If register pair RR2 contains %1234ABCD, the statement
SLAL RR2,#8
3-152
SLL
Shift Left Logical
L: mode 1 1 0 0 1 1 dst 0 1 0 1
i I I 1 1 i i i I I I
s re
i
Byte:
Word: c
15
Long:|c Rn
15
Rn
n=0,2,4,...,14
3-153
SLL
Shift Left Logical
FLAGS: C: Set if the last bit shifted from the destination was 1;
cleared otherwise
Z: Set if the result is zero; cleared otherwise
S: Set if the most significant bit of the result is set;
cleared otherwise
V: Undefined
D: Unaffected
H: Unaffected
CYCLES: Word/Byte Long
13+3*n 13+3*n (n=number of bit positons,
where 0 is equivalent to 1)
NOTE: The "src field" is encoded in the instruction format
as the 16-bit two's complement positive value of the
source operand. For each operand size, the operation
is undefined if the source operand is not in the
range specified above.
EXAMPLE: If register R3 contains %4321 (0100001100100001),
the statement
SLL R3,#l
will leave the value %8642 (1000011001000010) in R3
and clear the carry flag.
3-154
SOTDR
Special Output, Decrement and Repeat
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
The status pins indicate a special I/O reference.
This instruction can be interrupted after each exe-
cution of the basic operation. The program counter
value of the start of this instruction is saved before
the interrupt request is accepted, so that the
instruction can be properly resumed. Seven more cycles
should be added to this instruction's execution time
for each interrupt request that is accepted.
3-155
SOTIR
Special Output, Increment and Repeat
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set
D: Unaffected
H: Unaffected
CYCLES: Word/Byte
ll+10*n (n=number of data elements transferred)
NOTES: This is a privileged instruction.
The status pins indicate a special I/O reference.
3-156
SOUT
Special Output
3-157
SOUTD
Special Output and Decrement
3-158
SOUTI
Special Output and Increment
3-159
SRA
Shift Right Arithmetic
L: mode 1 1 0 0 1 1 dst 1 1 0 1
i l l l l _L L I I I I
src
i i i i i i i i i i i I I I
Byte:
15
,1
Word: 1 H
15
Rn
Long:
15
n=0,2,4,...,14
3-160
SRA
Shift Right Arithmetic
CYCLES: Word/Byte
13+3*n 13+3*n (n=number of bit positions,
where 0 is equivalent to 1)
NOTE: The "src field" is encoded in the instruction format as
the 16-bit two's complement negative value of the source
operand. For each operand size, the operation is undefined
if the source operand is not in the range specified above.
SRAB RH6,#2
will leave the value %OE (00001110) in RH6 and set the
carry flag.
3-161
SRL
Shift Right Logical
mode 1 1 0 0 1 1 dst 0 1 0 1
L: i I I I I I i i i I I I
src
i i i i i i i i i i i i i i
Byte:
15
Word: o-
D-S
15
Long: °~~"~|_ Rn
15
Rn
n=0,2,4,...,14
3-162
SRL
Shift Right Logical
CYCLES: Word/Byte
13+3*n (n=number of bit positions,
where 0 is equivalent to 1)
NOTE: The "src field" is encoded in the instruction format as
the 16-bit two's complement negative value of the source
operand. For each operand size, the operation is undefined
if the source operand is not in the range specified above.
EXAMPLE: If register RO contains %1111 (0001000100010001), the
statement
SRL R0,#6
will leave the value %0044 (0000000001000100) in RO and
clear the carry flag.
3-163
SUB
Subtract
3-164
TCC
Test Condition Code
3-165
TEST
Test
3-166
TRDB
Translate and Decrement
3-167
TRDB
Translate and Decrement
3-168
TRDRB
Translate, Decrement and Repeat
3-169
TRDRB
Translate, Decrement and Repeat
CYCLES: Byte
ll+14*n (n=number of data elements translated)
NOTES: The original contents of register RHl is lost, and is
replaced by an undefined value.
BEFORE
%1000 0 0 0 0 0 0 0 0
%1001 0 0 0 0 0 0 0 1
% 1002 0 0 0 0 0 0 1 0
•
%107F 0 1111111
%1080 0 0 0 0 0 0 0 0
%4000 %1081 0 0 0 0 0 0 0 1
%4001 %1082 0 0 0 0 0 0 1 0
%4002
•
%10FF 0 11 1 1 1 1 1
3-170
TRIB
Translate and Increment
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set if the result of decrementing r is zero; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Byte
3-171
TRIB
Translate and Increment
TABLE+ 0 0 0 1 0 0 0 0 0
TABLE+ 1 0 0 1 0 0 0 0 0
TABLE+ 2 0 0 1 0 0 0 0 0
•
TABLE+ 32 0 0 1 0 0 0 0 0
T A B L E + 33 0 0 1 0 0 0 0 1
TABLE+ 34 0 0 1 0 0 0 10
•
TABLE + 25s 1 1 1 1 1 1 1 1
3-172
TRIRB
Translate, Increment and Repeat
TRIRB d s t , s r c , r dst: IR
src: IR
FLAGS: C: Unaffected
Z: Undefined
S: Unaffected
V: Set
D: Unaffected
H: Unaffected
CYCLES: Byte
ll+14*n (n=number of data elements translated)
3-173
TRIRB
Translate, Increment and Repeat
LD R1,#STRING
LD R2,#TABLE
LD R3,#80
TRIRB @R1,@R2,R3
3-174
TRTDB
Translate, Test and Decrement
3-175
TRTDB
Translate, Test and Decrement
FLAGS: Unaffected
Set if the translation value loaded into RH1 is zero;
cleared otherwise
Unaffected
Set if the result of decrementing r is zero; cleared
otherwise
Unaffected
Unaffected
CYCLES: Byte
3-176
TRTDRB
Translate, Test, Decrement and Repeat
FLAGS: C: Unaffected
Z: Set if the translation value loaded into RH1 is zero;
cleared otherwise
S: Unaffected
V: Set if the result of decrementing r is zero; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Byte
ll+14*n (n=number of data elements tested)
NOTE: This instruction can be interrupted after each exe-
cution of the basic operation. The program counter of
the start of this instruction is saved before the in-
terrupt request is accepted, so that the instruction
can be properly resumed. Seven more cycles should be
added to this instruction's execution time for each
interrupt request that is accepted.
EXAMPLE; If register R6 contains %4002, the bytes at locations
%4000 through %4002 contain the values %00, %40, %80,
respectively, register R9 contains %1000, the transla-
tion table from location %1000 through %10FF contains
0,1,2,...,%7F,0,1,2,...,%7F (the second zero is
located at %1080) , and register R12 contains 3, the
statement
TRTDRB @R6,@R9,R12
will leave the value %40 in RH1 (which was loaded from
location %1040). Register R6 will contain %4000, and
R12 will contain 1. R9 will not be affected.
%1000 0 0 0 0 0 0 0 0
%4000 0 0 0 0 0 0 0 0 %1001 0 0 0 0 0 0 0 1
%4001 0 1 0 0 0 0 0 0 %1002 0 0 0 0 0 0 1 0
%4002 1 0 0 0 oooo • •
• •
• •
%107F 01111111
%1080 0 0 0 0 0 0 0 0
%1081 0 0 0 0 0 0 0 1
%1082 0 0 0 0 0 0 1 0
• •
• •
• •
%10FF 0 1 1 1 1 1 1 1
3-178
TRTIB
Translate, Test and Increment
3-179
TRTIB
Translate, Test and Increment
FLAGS: C: Unaffected
Z: Set if the translation value loaded into RH1 is zero;
cleared otherwise
S: Unaffected
V: Set if the result of decrementing r is zero; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Byte
TABLE + 0 1 0 0 0 0 0 0 0
TABLE +1 0 0 0 0 0 0 0 1
TABLE + 2 0 0 0 0 0 0 1 0
TABLE + 3 1 0 0 0 0 0 1 1
TABLE + 4 0 0 0 0 0 1 0 0
TABLE + 5 1 0 0 0 0 1 0 1
TABLE + 6 1 0 0 0 0 1 1 0
TABLE + 7 0 0 0 0 0 1 1 1
TABLE + 8 0 0 0 0 1 0 0 0
TABLE + 9 1 0 0 0 1 0 0 1
•
•
3-180
TRTIRB
Translate, Test, Increment and Repeat
TRTIRB s r c l , s r c 2 , r srcl: IR
s r c 2 : IR
3-181
TRTIRB
Translate, Test, Increment and Repeat
FLAGS: C: Unaffected
Z: Set if the translation value loaded into RHl is zero;
cleared otherwise
S: Unaffected
V: Set if the result of decrementing r is zero; cleared
otherwise
D: Unaffected
H: Unaffected
CYCLES: Byte
ll+14*n (n=number of data elements tested)
NOTE: This instruction can be interrupted after each execution
of the basic operation. The program counter of the
start of this instruction is saved before the interrupt
request is accepted, so that the instruction can be
properly resumed. Seven more cycles should be added
to this instruction's execution time for each interrupt
request that is accepted.
EXAMPLE The following sequence of instructions can be used to
scan a string of 80 bytes, testing for special char-
acters as defined by corresponding non-zero translation
table entry values. The pointers to the string and
translation table are set, the number of bytes to scan
is set, and then the translation and testing is
accomplished. The Z and V flags can be tested after
the operation to determine if a special character was
found, and whether the end of the string has been
reached. The translation value loaded into RHl might
then be used to index another table, or to select one
of a set of sequences of instructions to execute next.
LD R4,#STRING
LD R5,#TABLE
LD R6,#80
TRTIRB @R4,@R5,R6
JR NZ,SPECIAL
END OF STRING:
SPECIAL:
JR OV,LAST CHAR SPECIAL
3-182
TSET
Test and Set
3-183
TSET
Test and Set
3-184
XOR
Exclusive OR
00
R
R IM (src field=0)
00 R IR (src fieldOO)
01 R DA (src field=0)
01 R X (src fieldOO)
3-185
3.4 ÜNIMPLEMENTED INSTRUCTIONS
As explained in Section 1.6.4, certain binary instruction codes
are defined by the Z8000 architecture, but are not currently
implemented by the hardware. The following opcodes (listed by
the first instruction word in hexadecimal where "x" means any
value) will cause an Unimplemented Instruction trap if an
attempt is made to execute them:
OExx
OFxx
4Exx
4Fxx
8Exx
8Fxx
NOTE
3-186
Section 4
Structuring a Z8000 Program
4.1 INTRODUCTION
4.2.1 Modules
A Z8000 PLZ/ASM program consists of one or more separately-coded
and assembled modules. These modules are combined into an
executable program using the module linkage end relocation
facilities of an operating system such as Z-80 RIO. One of the
modules should include a "main program"; that is, a GLOBAL
procedure whose name is supplied to the linking facility as the
program's entry point.
PLZ/ASM modules are made up of high-level and assembly-language
statements that either declare or define data or perform some
action. The assembly-language statements described in Section 3
are action statements. In general, data definition equates an
identifier with a fixed value or type, whereas data declaration
equates an identifier with a variable and associates a type with
it.
Data, labels, or procedures can be shared between modules by
declaring them to be GLOBAL in one module and declaring them as
EXTERNAL in other modules that reference them. Data, labels, or
procedures declared as INTERNAL to a module may be referenced
only within that module. See Section 4.2.5 for more explanation
of the scope of these objects.
The following example is the skeleton of a module showing two
procedures, the second of which is a main program.
4-1
bubble_sort MODULE
CONSTANT
false := 0 IConstant definition!
true := 1
EXTERNAL
list ARRAY [10 WORD] lExternal variable
declared in another module
4.2.2 Procedures
A procedure declaration defines an executable portion of a module
(including both action and data statements). It also associates
an identifier with that block of code so that it can be activated
by the assembly-language CALL statement. (See the "CALL sort"
statement in the preceding example).
Every procedure declaration also has a scope associated with it.
It can be:
• GLOBAL (the procedure can be called from other
modules) ;
• INTERNAL (it can be called only within the
current module);
• EXTERNAL (it is called from the current module,
but is declared as GLOBAL in another module).
4-2
E3-3055-01 07/02/79
A procedure declaration can include LOCAL variables or label
declarations as shown in the following example. LOCAL variables
and labels can be referenced only within the procedure in which
they are declared.
!(action statements)!
•
OD !End DO loop!
END sort !End of procedure!
_/ 4.2.3 DO Loops
4-3
The following example enlarges upon the original "bubblesort"
skeleton and also introduces the IF statement.
DO
LDB switch, #false
CLR Rl
DO INote nested DO loop!
CP Rl, RO
IF UGE THEN EXIT FI !IF statement at inner level
INC Rl, #2
OD !End nested DO loop!
CPB switch, #false
IF . . . FI !IF statement at outer level!
OD !End DO loop!
4.2.4 IF Statements
4-4
The following example shows a brief IF statement followed by a
longer one.
IF UGT THEN
LDB switch, #true
LD list(Rl), R6
LD list(R2), R4
FI
4.2.5 Scope
4-5
For variable and label declarations, GLOBAL specifies that the
variable is declared in the current module but may be used in
other modules. GLOBAL variables have a scope of the entire
executable program. EXTERNAL specifies that the variable is used
in the current module but declared as GLOBAL in another module.
INTERNAL specifies that the variable is declared in the current
module and is accessible only within the current module. LOCAL
specifies that the variable can be accessed only inside the
procedure in which it is declared. GLOBAL, EXTERNAL, and
INTERNAL can only be specified at the module level; LOCAL can
only be used at the procedure level.
For variables declared with type RECORD, the scope of a record
field is the module or procedure in which it is defined. Note
that this implies that record fields must have names that are
unique within their scope.
Procedure declarations must be either GLOBAL, EXTERNAL, or
INTERNAL, as defined for variables above. The name given to the
procedure as part of the procedure declaration is recognized in
the entire scope of the enclosing module.
Constant identifiers are defined using the CONSTANT class, and
can be defined only at the module level. The scope of a constant
identifier is the module scope, and it cannot be used outside the
module unless it is redefined.
Type identifiers are defined using the TYPE class. They can be
defined only at the module level and are recognized only within
the scope of the module.
4.2.6 Summary
The preceding sections were intended only as an introduction to
program structuring. The detailed formats of the declarations
used to define the program structure are listed in Section 5.
Even without those details, however, the following module should
be comprehensible at this point. If any statement looks foreign,
reread the part of Section 3 or 4 that explains its operation.
4-6
An example of a complete bubble_sort module for sorting a 10-word
array is as follows: ~
E3-3055-01 07/02/79
4.3 RELOCATABILITY
4.3.1 Sections
4-9
represents a 16-bit offset within the current section. The
offset may be either an absolute value, or it may represent a
relocatable value which may be adjusted depending on where the
module's portion of the section is finally allocated at link or
load time. Relocatable and absolute portions of a section may be
specified in the same module or program.
If the $ABS assembler directive has been specified, the location
counter reflects the absolute location of the current statement;
if $REL has been specified, the counter reflects the relocatable
offset of the statement. If neither is specified, the counter
defaults to relocatable offset 0 at the beginning of a module.
The location counter symbol "$" may be used in any expression,
and represents the address of the first byte of the current
instruction.
4-10
An external expression is one containing exactly one external
identifier, possibly extended by adding or subtracting an
absolute expression. An external identifier is one that is used
in the current module but defined in another module (Section
4.2.5). The value of an external identifier is not known until
the modules are linked.
LD RO, timer count lExternal if timer_count was
defined outside current module!
In the following summary, "AB" stands for an absolute value or
expression, "RE" stands for a relocatable value or expression,
and "EX" is an external identifier or expression. "operator" is
one of the standard arithmetic or logical operators (+, -, *,
LOR, LAND, etc.).
a relocatable identifier
RE + AB
AB + RE
RE - AB
+RE
4-11
In general, the second example would be invalid no matter which
arithmetic or logical operator was used to combine LOOPl and
LOOP2. The one exception is subtraction. Suppose LOOP2 is the
label of the first statement following a procedure named LOOPl.
The statement
JP Z, LOOP1*4 !INVALID!
4-12
Section 5
PLZ/ASM High-level Statements
5-1
For example:
CONSTANT
constant_identifier ':=' constant_expression
RECORD '[' identifier* type ']'
END sine_computation
5-2
are recognized only within the procedure in which they are
declared.
The format of the procedure declaration is:
procedure_identifier PROCEDURE
[LOCAL
[variable_identifier+ type]*]*
[ENTRY
action_statement*]
END procedure_identifier
where
identifier conforms to the rules for
identifiers (Section 2.2.1).
type is BYTE, SHORT_INTEGER, INTEGER,
WORD, LONG, LONG_INTEGER, LABEL,
ARRAY, RECORD or a user_defined
type (Sections 5.3.2 through 5.3.4).
GLOBAL
suml BYTE
add_routine PROCEDURE
LOCAL
sum BYTE
ENTRY
LDB RH2,suml
ADDB RH2,#72
LDB sum,RH2
CALL print
RET
END add_routine
Note that the RET instruction precedes the END statement. If RET
is not present, control will fall through to the statement
following the END statement.
5-3
5.2.3 DO Statement
[label]*
DO
action_statement*
OD
where
label conforms to the rules for labels
(Sections 2.2.1 and 5.3.5) and is
used to identify the DO block for
use with multi-level EXIT and
REPEAT statements.
action statement is zero or more assembly-language,
DO, IF, REPEAT, or EXIT statements,
or a combination of these
statements.
5-4
The assembler automatically inserts a single unconditional jump
to the instruction following the indicated OD keyword. Either a
JR or JP is generated depending on the range of the EXIT, with a
JR used whenever possible.
The REPEAT statement causes execution to continue at the first
statement of the innermost DO...00 block containing the REPEAT.
It can also be qualified by a label indicating a specific DO...OD
block to which execution is to proceed. Its format is:
REPEAT [FROM label]
where
label conforms to the rules for labels
(Sections 2.2.1 and 5.3.5).
5.2.4 IF Statement
The IF statement specifies that the statements between the
keywords THEN and ELSE (or between THEN and FI if the ELSE clause
is omitted) are to be executed if the specified condition code is
true. If the condition is false and the ELSE clause is present,
the statements between ELSE and FI are executed. If the
condition is false and the ELSE clause is omitted, execution
continues with the statement following FI.
The format of the IF statement is:
IF condition_code
THEN actionl_statement*
[ELSE action2_statement*]
FI
5-5
where
5-6
5.2.5 IP-CASE Statement
5-7
5.3 DEFINING DATA
Data (constants and variables) must be defined or declared so
that it can be referenced accordingly. In general, data
definition associates an identifier with a fixed value or type.
Data declaration introduces an identifier as the name of a
variable and associates a scope and type with it. The following
three statements are used to define and declare data:
• The constant-definition statement (CONSTANT), which
associates a constant identifier with a fixed value;
• The type-definition statement (TYPE), which associates
a type identifier with a fixed type;
• The variable declaration which associates a variable
identifier with a scope, type, and (optionally) an
initial value.
5-9
SHORT INTEGER or BYTE An 8-bit quantity whose value
can be signed (-128 to +127)
or unsigned (0 to 255). This
value may also represent a
single character from the
ASCII character set.
TYPE
CHAR BYTE
small_value BYTE
large_value LONG_INTEGER
letter CHAR
Structured Types. Structured types are defined by indicating the
structuring method to be used and the types of all elements
within the selected structure. Two structuring methods are
available: ARRAY and RECORD.
Array Structures. An array structure is a collection of variable
elements, each of which has the same type. When referenced, the
identifier associated with the ARRAY type refers to the entire
array structure. Arrays with N elements are indexed from 0 to
N-l; for example, a 10-element array has index 0 as the first
element and index 9 as the last element.
Individual elements within an array can be accessed in several
different ways. A particular element's address may be calculated
at run-time, for instance, by specifying an indexed address mode.
At assembly-time, a particular element's address can be specified
by an expression containing the array identifier and a fixed
offset or by an array identifier followed by one or more constant
expressions enclosed within square brackets. In the latter case,
each constant expression represents an index for the particular
"dimension" of the array, and the assembler's calculation of the
desired element's address may involve an implicit multiplication
by the size of each dimension or by the size (in bytes) of the
element type (see Section 5.3.4).
5-10
Example
TYPE
STRING ARRAY [26 BYTE]
INTERNAL
alpha STRING
!The array identifier "alpha" is defined as a 26-byte
array!
LD R5, #0
LDB alpha(R5), #'A 1
LDB alpha+1, #'B'
LDB alpha[2], #'C 1
!The first element of array alpha now contains 'A', the
second element contains 'B 1 , and the third element
contains 'C'!
5-11
Therefore, statement labels which are to be accessible throughout
the module need not be declared, although they can be explicitly
declared INTERNAL for documentation purposes. If a label is to ^/
have GLOBAL, EXTERNAL, or LOCAL scope, however, it must be
declared explicitly in a label declaration statement.
GLOBAL
TRIG_FUNCTION LABEL
5-12
Example:
TYPE
limitl BYTE
Iimit2 LONG
5-13
5.3.4 Variable Declaration
The variable declaration statement is used to declare the type of
variable identifiers and optionally to define their initial
values. Its basic format is:
5-14
Simple variables are initialized in one of two ways: with a
single constant expression, or with a list of constant
expressions enclosed in square brackets. In the first case, only
one variable may appear in the declaration and is initialized to
the constant value. If a list is supplied, the variables are
initialized in left-to-right order from the initial-value list.
The initial-value list may have fewer items than the
variable-identifier list, but an error results if the
initial-value list is longer.
Example:
INTERNAL
HUE BYTE
limit WORD := %FFFF
total, subtotal BYTE := [0...]
A, B, X BYTE := ['A', 'B', 'X']
D, E, F BYTE := [0, 1]
!D=0, E=l, F is still undefined!
Array Variable Declaration. An array variable is one whose type
is ARRAY. An array variable declaration has the format:
5-15
E3-3055-01 07/02/79
initial_value is a bracketed list of constant
expressions, or a character
sequence as detailed below.
Example:
INTERNAL
matrix ARRAY [10 10 LONG_INTEGER]
list ARRAY [10 BYTE] := [0,1,0,0,1]
TABLE ARRAY [4 BYTE] := ['T1, 'O 1 , 'D1, 'S']
ONEDIM1, ONEDIM2 ARRAY [2 BYTE] := [[!...][2...]]
5-16
Record Variable Declaration. A record variable is a variable
whose type is RECORD. A record variable declaration specifies an
identifier for the record as a whole and an identifier and type
for each field within the record. A field type may be ARRAY or
RECORD, as well as a simple type.
A record variable declaration has the format:
where
identifier conforms to the rules for identifiers
(Section 2.2.1).
type is BYTE, SHORT_INTEGER, WORD, INTEGER,
LONG, LONG_INTEGER, a previously-defined
type identifier, or is an ARRAY or
RECORD type definition.
record_type is a previously-defined RECORD type
identifier.
initial value is a bracketed list of. constant
expressions.
5-17
do not have to be specified. Furthermore, if more than one
structured variable identifier appears in a single declaration,
then the part of the initial value list corresponding to each
structured variable must also be enclosed by square brackets.
TYPE
PATIENT RECORD [ ROOM WORD
BIRTH RECORD [DAY,MO,YR BYTE]
SEX BYTE]
INTERNAL
FEMALE ARRAY [100 PATIENT] :=[[?,[],'F']...]
lonly the SEX field of each record is initialized!
Alignment. If the current location counter value is even, then
any data variable or instruction may start at that address.
However, if the current location counter value is odd, then only
8-bit values may start at that address. The assembler
automatically aligns simple variables so that word (WORD or
INTEGER) or long word (LONG or LONG_INTEGER) variables are
located at even addresses. This is accomplished by inserting a
byte with an undefined value when the location counter value is
odd, thus forcing the word or long word to stert at the next
higher even address. Instructions within a procedure are also
automatically aligned.
Structured variables are, in general, automatically aligned; that
is, all array or record variables are forced to start at an even
address (an undefined byte value is inserted if the location
counter was odd). An exception to this rule is made for arrays
whose elements are any 8-bit type (based on BYTE or
SHORT_INTEGER), which do not have to be aligned on an even
address boundary.
It is the programmer's responsibility to ensure that all
variables within a structure are aligned properly. The
programmer should be careful to align record fields on their
appropriate address boundaries relative to the start of the
record. This can be accomplished by defining "filler" fields
where necessary to force the alignment of the following field.
5-18
E3-3055-01 07/02/79
5.3.5 Label Declaration
The label declaration statement specifies that an identifier is
used in the program as a statement label. It cannot be used for
any other purpose within its defined scope. The format of the
label declaration is:
label declaration+ LABEL
where
label identifier conforms to the rules for
identifiers in Section 2.2.1
Note that the colon (:) that follows a label identifier when it
appears in an executable statement (Section 2.2.1) is not
included when the label is identified in a label declaration
statement. Note also that labels cannot be given an initial
value (that is, the label declaration cannot be used to assign
absolute addresses).
A label can have GLOBAL, EXTERNAL, INTERNAL, or LOCAL scope
(Section 4.2.5). If a label is used in an executable statement
without being declared in a label declaration statement, it is
assumed to be INTERNAL to the module in which it appears. This
default scope can be overridden by explicitly declaring the scope
of the label.
Notice that a label with LOCAL scope must be declared in the
procedure declaration before the ENTRY keyword; that is, before
the label is used or defined, whereas a label with GLOBAL,
EXTERNAL, or INTERNAL scope may be used before it is either
declared or defined. To allow the programmer to avoid
pre-declaring LOCAL labels, Z8000 PLZ/ASM provides a special form
of statement labels which are always of LOCAL scope and cannot be
declared explicitly. The form of a special label is a dollar
sign "$", followed immediately by any valid decimal number, and
it can be used in the same manner as a regular statement label
identifier, except that its scope is always limited to the
procedure in which it is defined.
5 19
E3-3055-01 07/02/79
Example:
GLOBAL
STEP3 LABEL
processlO PROCEDURE IProcedure has GLOBAL scope!
LOCAL
a,b,c BYTE
STEP2 LABEL
ENTRY
STEP1: ... 1STEP1 has INTERNAL scope!
ISTEP2 is LOCAL to
"processlO"!
END processlO
5-20
E3-3055-01 07/02/79
Appendix A
Instruction Set Summary
TO BE PUBLISHED
A-l
Appendix B
High-Level Statement Summary
DO Introduces DO loop.
ELSE Used in IF conditional-execution
statement. Statements between ELSE
and FI are executed if the specified
condition is false.
END Module or procedure terminator.
B-l
GLOBAL Declares variables and/or procedures
to have a scope of the entire
executable program.
IF Introduces IF statement. Code
following IF-THEN is executed if the
specified condition is true.
INTEGER One of the simple variable types.
Equivalent to WORD.
B-2
TYPE Introduces type definition(s).
WORD One of the simple variable types.
Used in type definition and variable
declaration statements.
B-3
PLZ/ASM GRAMMAR - MODULE SYNTAX
:
declarations > constants
:
> types
:
> globals
=> internals
=> externals
B-4
E3-3055-01 07/02/79
character_constant => character_sequence
type definition => type identifier type
— —
type => simple_type
=> structured_type
B-5
variable_initial_declaration
=> identifier simple_type
':=' initial_value J
=> identifier identifier* simple_type
1
:=' '[' initial value*
['...'] ' ] '
=> identifier structured_type
1
:=' constructor
=> identifier identifier+ structured_type
':=' '[' constructor*
['...'I '] '
=> identifier ARRAY
1
t' '*' simple_type ']'
1
:=' '[' initial_value+ ']'
=> identifier ARRAY
1
[ ' '*' simple_type ']'
':=' character_sequence+
constructor = > ' [' initial component*
['...'I '] '
initial_component => initial_value
=> constructor
B-6
procedure declaration => procedure_identifier
PROCEDURE
locals*
[ENTRY
statement*]
END procedure_identifier
B-7
operand => register
=> indirect_register
=> immediate
:
> indexed_address
=> based_address
=> based_indexed_address
=> direct_address
=> relative_address
=> condition_code
=> flags
=> int
register => single_register
=> double_register
=> low_byte_register
=> high_byte_register
=> quad_register
=> special_register
single_register => RO | Rl | R2 | R3 | R4 | R5 |
R6 | R7 | R8 | R9 | RIO | Rll
R12 | R13 | R14 | R15
B-8
E3-3055-01 07/02/79
, address_designator => ' I ' seg_address_designator ' I '
=> seg_address_designator
condition_code => Z I NZ | EQ I NE I MI I PL I
C i NC | 0V | NOV | LT | GE |
LE | GT | ULT | UGE ! ULE I UGT
PE I PO
flags => C | Z l S | P | V
B-9
E3-3055-01 07/02/79
Z8000_instruction => ADC I ADCB | ADD | ADDB | ADDL |
AND | ANDB | BIT I BITS I CALL I
CALR | CLR | CLRB | COM | COMB |
COMFLG | CP I CPE I CPL I CPD I
CPDB | CPDR | CPDRB | CPI I CPIB |
CPIR I CPIRB | CPSD I CPSDB | CPSDR I
CPSDRB | CPSI | CPSIB | CPSIR |
CPSIRB | DAB | DBJNZ I DEC I DECB I
DI | DIV | DIVL | DJNZ I El | EX |
EXB | EXTS | EXTSB I EXTSL | HALT I
IN | INB | INC | INCB | IND | INDB I
INDR | INDRB I INI | INIB I INIR I
INIRB | IRET I JP | JR | LD | LDA |
LDAR | LDB I LDCTL I LDCTLB I
LDD | LDDB I LDDR | LDDRB | LDI |
LDIB | LDIR | LDIRB | LDK I LDL |
LDM | LDPS | LDR | LORE | LDRL I
MBIT | MREQ I MRES I MSET I MULT I
MULTL | NEC I NEGB | NOP | OR |
ORB | OTDR | OTDRB I OTIR I OTIRB I
OUT I OUTB I OUTD | OUTDB | OUTI I
OUTIB | POP | POPL | PUSH I PUSHL I
RES | RESB | RESFLG I RET | RL |
RLE | RLC | RLCB | RLDB I RR | RRB I
RRC | RRCB | RRDB I SBC I SBCB | SC I
SDA I SDAB j SDAL | SDL | SDLB I
SDLL | SET I SETB | SETFLG | SIN I
SINE l SIND | SINDB I SINDR | SINDRB I
SINI | SINIB | SINIR | SINIRB I SLA |
SLAB I SLAL I SLL | SLLB I SLLL I
SOTDR | SOTDRB | SOTIR | SOTIRB |
SOUT | SOUTB | SOUTD I SOUTDB I
SOUTI | SOUTIB | SRA j SRAB | SRAL |
SRL | SRLB | SRLL I SUB I SUBB I
SUBL | SWAP | TCC I TCCB I TEST I
TESTE | TESTL | TRDB | TRDRB I TRIE I
TRIRB j TRTDB I TRTDRB I TRTIB I
TRTIRB I TSET I TSETB I XOR | XORB
B-10
PLZ/ASM GRAMMAR - LEXICAL SYNTAX
B-ll
digit '0' 'l1 '2' '3' '4'
'5' '6' '7' '8' .9.
B-12
Appendix C
Assembler Directives and
Extended Instructions
C.l ASSEMBLER DIRECTIVES
C-l
$SECTION identifier Causes the object code produced to be
associated with a symbolic identifier
which can be used later for mapping
into one of the memory areas.
Remains in effect until either
another $SECTION directive is
encountered, or until a $SDEFAULT
directive restores default memory
assignment.
C-2
Appendix D
Reserved Words and Special Characters
Certain special symbols are reserved for Z8000 PLZ/ASM and can
not be redefined as symbols by the programmer. These are the
names of operators, condition codes, register symbols, assembly
language instructions, and high-level statement keywords. The
specific reserved words are listed below.
NAMES OF OPERATORS
LAND OFFSET
LNOT SEG
LOR SHL
LXOR SHR
MOD SIZEOF
C V
NVI VI
P Z
s
CONDITION CODES
C LE NE PE UGT
EQ LT NOV PL ULE
GE MI NZ PO ÜLT
GT NC 0V UGE Z
FCW PSAP
FLAGS PSAPOFF
NSP PSAPSEG
NSPOFF REFRESH
NSPSEG
D-l
ASSEMBLY LANGUAGE INSTRUCTIONS
When defining symbols, users should also avoid the forms Rn, RHn,
RLn, RRn, and RQn where' n is a number from 0 to 15.
EXTENDED INSTRUCTIONS
BVAL
LVAL
WVAL
D-2
D. 2 SPECIAL CHARACTERS
The list of special characters below includes delimiters and
special symbols. The difference between them is that delimiters
have no semantic significance (for example, two PLZ/ASM tokens
can have any number of blanks separating them) , whereas special
symbols do have semantic meaning (for example, # is used to
indicate an immediate value) .
The class of delimiters includes the space (blank) , tab, form
feed, line feed, carriage return, semicolon (;), and comma (,).
The comment construct enclosed in exclamation points (!) is also
considered a delimiter.
D-4
Appendix E
Hex-ASCII Table
The following table lists the ASCII character set and the
hexadecimal representation for each character code.
E-l
GRAPHIC OR HEX GRAPHIC OR HEX
CONTROL CODE CONTROL CODE
P 50 h 68
Q 51 i 69
R 52 j 6A
S 53 k 6B
T 54 l 6C
U 55 m 6D
V 56 n 6E
W 57 0 6F
X 58 p 70
y 59 q 71
z 5A r 72
[ 5B s 73
\ 5C t 74
] 5D u 75
T 5E v 76
5F w 77
60 x 78
a 61 y 79
b 62 z 7A
c 63 { 7B
d 64 1 7C
e 65 } (ALT MODE) 7D
f 66 7E
g 67 DEL (RUB OUT) 7F
E-2
DOCUMENT CHANGE NOTICE
DATE: 07-02-79
vii 4-1
4-7
3-19
G
3:55
3-59
l-u
5-19
-Äite--
3-77
3-123 B-3
3-127 B-7
3-129 B-9
3-131
3-133
CF 1017 01A