Decimal Arithmetic Instructions - RCA 70/46 Reference Manual

Table of Contents

Advertisement

DECIMAL
ARITHMETIC
INSTRUCTIONS
INTRODUCTION
DATA FORMATS
Packed Format
Zoned Format
Description of Formats
Decimal arithmetic is performed on data in packed format. In this
format, two decimal digits are placed in one byte (four bits each). The
operands may be variable in length, and must contain a sign in the right-
most four bits.
All decimal instructions are two-address, SS-type format. The instruc-
tion set includes addition, subtraction, comparison, multiplication, and divi-
sion. Since data sent
to,
and from, external devices are usually in zoned
(unpacked) format (one digit in one byte), there are also instructions for
converting to, and from, packed and zoned format. All decimal arithmetic
instructions are standard features of the 70/46 Processor.
The formats for decimal data in high-speed memory are:
Byte
Byte
Byte
Digit : Digit
Digit:
Digit
Digit: Digit
I
I
I
Byte
I
Digit
I
Digit
I
Byte
I
Digit I Digit
I
Byte
I
Digit : Sign
In packed format, one byte represents two decimal digits. The right-
most half-byte (4 bits) of a field represents the sign.
Byte
Byte
I
Zone:
Digit
Byte
I
Zone
I
Digit
I
Byte
Byte
Byte
I
Zone
I
Digit
In zoned format, the low-order four bits of each eight-bit byte contain
the decimal digit and the high-order four bits contain the zone. The
high-order four bits of the rightmost byte of a field contain the sign
of the field.
Decimal arithmetic instructions operate from right to left. The addresses
specify the leftmost byte of the operand, and the length specifies the addi-
tional number of bytes that are to the right of the addressed byte. The
fields specified by the addresses can be variable in length beginning at any
byte in main memory and consisting of from 1 to 16 eight-bit bytes. Results
of operations are always placed in the first operand field. The result never
exceeds the limits set by the address and length of the first operand field.
If a decimal arithmetic operation results in a carry outside the operand
limits, a decimal overflow interrupt occurs. If the first operand is longer
than the second, the second operand is extended with high-order zeros
up to the length of the first operand during operation execution (in addition
and subtraction only). This extension never changes main memory.
Because the code configurations of digits and sign are verified while
arithmetic operations are performed, improper overlapping of fields is
recognized as a data error. The arithmetic instruction set (except Pack,
Unpack, Move with Offset) should not specify overlapping fields unless
the rightmost byte of the fields coincide.
In the move-type instructions of this set (Pack, Unpack, Move with
Offset), no checking is made for valid codes. Consequently, overlapping is
permitted without any restrictions. (Although unusual results are possible,
overlapping is dangerous.)
154

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Spectra 70

Table of Contents