Exercises - RCA Spectra 70 Training Manual

System
Hide thumbs Also See for Spectra 70:
Table of Contents

Advertisement

that valid numeric characters (or a sign) exist. The
first byte position processed in the sending field
merely has its half bytes transposed and sent to the
receiving (packed) field. Each successive byte in
the sending field has its zone portion stripped and
the numeric portion forms successive half-bytes in
the packed field.
UNPACK INSTRUCTION (UNPK)
The unpacking operation is the reverse of the pack-
ing operation.
The first byte in the sending (packed) field is pro-
cessed by having its zone (sign) and numeric por-
tions reversed and sent to the receiving (unpacked)
field.
Each successive half-byte in the packed field forms
a byte in the unpacked field with a zone portion of
F16 (1111)2 being generated by hardware during
execution of the instruction.
As an example of the Unpack instruction assume that
it is desired to print a balance field as a part of an
output record.
The balance field is a packed field that has accumu-
lated the transaction amounts. Assume it is in pack-
ed format and contains the following value:
PACKED
(SENDING)
FIELD
40
50
00
BAL
51
17
52 53
24 3S
An area for printing the balance field has been al-
located as follows:
NAME
OPERATION
OPERAND
ASSUMED HSM
ALLOCATION
PBAL
DS
7C
5037-5043
The instruction as shown below would unpack BAL
with the result in the field PBAL.
ASSEMBLY
INSTRUCTIOX
OP
GENERATED
INSTRUCTION
I
F316
I
OPERATION
OPERAl'ID
UNPK
PBAL(7), BAL(4)
Ll
L2
Bl
Dl
B2
D2
6
1
3
1
210
I
0941 10
1
110 14050101
General Register one contains 0000
General Register two contains 4096
10
27
UNPACKED
(RECEIVING)
FIELD
*
F
=
F 16
=
11112
S
=
Sign
PBAL
50
37 38 39 40 41 42 43
FO FO F1 F7 F2 F4 S3
The receiving (unpacked) field can be considered the
controlling field. If it is larger than necessary,
high-order bytes are filled with the numeric charac-
ter zero FOI6.
If it is not large enough to receive all digits in the
sending (packed) field, the high-order digit(s) of the
sending field are truncated.
To determine the size of the unpacked field necessary
to receive the digits in a packed field, the size (in
bytes) of the packed field should be doubled and one
should be subtracted for determining the number of
bytes necessary.
Exercise:
Assume that the following allocations have been
made:
NAME
OPERATION
OPERAND
ORG
2000
BAL
DS
5C
DS
3C
WDAT
DS
5C
ORG
2150
DATA
DS
3C
DS.
6C
WBAL
DS
4C
and that the allocated areas contain the hexadecimal
values as shown below:
BAL
WDAT
~
,?'-
20
00 01 02 03 04 05 06 07 08 09 10 11 12
FO Fl F2 F5 C7 FO C3
D4"TA
"JVBAL
21
50 51 52 53 54 55 56 57 58 59 60 61 62
00 24 5C
Answer each of the following questions by writing the
assembly instruction in the space provided and show-
ing the result of the instruction in the blank locations
above.
1.
Pack 'BAL' in 'WBAL'
2.
Unpack 'DATA' in 'WDATA'

Advertisement

Table of Contents
loading

This manual is also suitable for:

Spectra 70/25

Table of Contents