Download Print this page

IBM 4300 Manual page 278

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

is executed, the value of the first argument byte,
the letter U, is added to the starting address of the
table to produce the address of the table entry to
be examined:
Table starting address
2000
First argument byte (U)
E4
Address of table entry
20E4
Because zeros were placed in storage location
20E4, no special action occurs. The operation
continues with the second and subsequent argument
bytes until it reaches the blank in location CA84.
When this symbol is reached, its value is added to
the starting address of the table, as usual:
Table starting address
2000
Argument byte (blank)
40
Address of table entry
2040
Because location 2040 contains a nonzero value,
the following actions occur:
1. The address of the argument byte, 00CA84, is
placed in the rightmost 24 bits of register 1.
2. The table entry, 04, is placed in the rightmost
eight bits of register 2, which now contains 00
00 3004.
3. Condition code 1 is set (scan not completed).
The TRANSLATE AND TEST instruction may
be followed by instructions to branch to the routine
at the address found at location 3004, which
corresponds to the blank character encountered in
the scan.· When this routine is completed, program
control may return to the TRANSLATE AND
TEST instruction to continue the scan, except that
the length must first be adjusted for the characters
already scanned.
For this purpose, the TRANSLATE AND TEST
may be executed by the use of an EXECUTE
instruction, which supplies the length specification
from a general register. In this way, a complete
statement scan can be performed with a single
TRANSLATE AND. TEST instruction repeated
over and over by means of EXECUTE, and without
modifying any instructions in storage. In the
example, after the first execution of TRANSLATE
AND TEST register 1 contains the address of the
last argument byte translated.
It
is then a simple
matter to subtract this address from the address of
the last argument byte (CA94) to produce a length
specification. This length minus one is placed in
the register that is referenced as the Rl field of the
EXECUTE instruction. (Note that the length code
in the machine format is one less than the total
number of bytes in the field.) The second-operand
address of the EXECUTE instruction points to the
TRANSLA TE AND TEST instruction, which is the
same as illustrated above, except for the length (L)
which is set to zero.
UNPACK (UNPK)
Assume that storage locations 2501-2502 contain a
signed, packed-decimal number that is to be
unpacked and placed in storage locations
1000-1004. Also assume:
Register 12 contains 00 00 10 00.
Register 13 contains 00 00 25 00.
Storage locations 2501-2502 contain 12
3~.
The initial contents of storage locations 1000-1004 are not
significant.
After the instruction:
Machine Format
Op Code
F3
4
C
I
0001
°
I
001
1
Assembler Format
Op Code
D1(L1,B1),D2(L2,B2)
UNPK
0(5,12),1(2,13)
is executed, the storage locations 1000-1004
contain FO FO Fl F2 D3.
Decimal Instructions
(See Chapter 8.)
ADD DECIMAL (AP)
Assume that the signed, packed-decimal number at
storage locations 500-503 is to be added to the
signed, packed-decimal number at locations
2000-2002. Also assume:
Register 12 contains 00 0020 00.
Register 13 contains 00 00 05 00.
Storage locations 2000-2002 contain 38 46 00 (a negative
number).
.
Storage locations 500-503 contain 01 12 34 5C (a positive
number).
After the instruction:
Machine Format
Op Code
FA
2
3
C
I
0001
° I
0001
Appendix A. Number Representation and Instruction-Use Examples
A-25

Advertisement

loading