Download Print this page

IBM 4300 Manual page 276

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

Advertisement

consists of eight bits or fewer. In the following
example, EBCDIC is translated to ASCII. The first
step is to create a 256-byte table in storage
locations 1000-1 OFF. This table contains the
characters of the target code in the sequence of the
binary representation of the source code; that is,
the ASCII representation of a character is placed in
storage at the starting address of the table plus the
binary value of the EBCDIC representation of the
same character. For simplicity, the example shows
only the part of the table containing the decimal
digits:
Translate Table for Decimal Digits:
10FO
10F9
130131132133134135/36137/38/391
Assume that the four-byte field at storage
location 2100 contains the EBCDIC code for the
digits 1984:
Locations 2100-2103 contain F1 F9 F8 F4.
Register 12 contains 000021 00.
Register 15 contains 00 00 10 00.
As the instruction:
Machine Format
Op Code
L
DC
03
C / 000/
F
I
000/
Assembler Format
Op Code
D1(L,B1),D2(B2)
TR
0(4,12),0(15)
is executed, the binary value of each source byte is
added to the starting address of the table, and the
resulting address is used to fetch a target byte:
Table starting address:
1000
First source byte:
Fl
Address of target byte:
10Fl
After execution of the instruction:
Locations 2100-2103 contain 31 39 38 34.
Thus, the ASCII code for the digits 1984 has
replaced the EBCDIC code in the four-byte field at
storage location 2100.
TRANSLATE AND TEST (TRT)
The TRANSLATE AND 'TEST instruction can be
used to scan a data field for characters with a
special meaning. To indicate which characters have
a special meaning, a table similar to the one used
for the TRANSLATE instruction is set up, except
that zeros in the table indicate characters without
any special meaning and nonzero values indicate
characters with a special meaning.
The figure "Translate-and-Test Table" that
follows has been set up to distinguish alphameric
characters (A to Z and 0 to 9) from blanks, certain
special symbols, and all other characters which are
considered invalid. EBCDIC coding is assumed.
The 256-byte table is assumed stored at locations
2000-20FF.
Appendix A. Number Representation and Instruction-Use Examples
A-23

Advertisement

loading