PSW ASCII bit definition from 360 Principles of Operation
Hal Perkins
hal at cornell.UUCP
Sun May 20 12:55:45 AEST 1984
Enough already. Here's the description of the ASCII bit in the PSW
from the IBM 360 Principles of Operation (GA22-6821-8, Nov. 1970)
page 71. [Interpolations by the typist surrounded by brackets.]
"ASCII(A): When bit 12 of the PSW is one, the codes preferred for
the USASCII-8 code are generated for decimal results. When PSW
bit 12 is zero, the codes preferred for the extended binary-coded-
decimal interchange code [that's EBCIDIC folks] are generated.
"The following instructions cause either the sign or zone code
to be generated in accordance with the setting of PSW bit 12:
Add Decimal (sign code)
Subtract Decimal (sign code)
Zero and Add (sign code)
Multiply Decimal (sign code)
Divide Decimal (sign code)
Unpack (zone code only)
Convert to Decimal (sign code)
Edit (zone code)
Edit and Mark (zone code)"
That's ALL that it does.
As for the EDIT instruction and EDMK, bytes with values X'20', X'21',
and X'22' have special signficence in edit patterns, so use of ASCII
characters could cause trouble. This behavior is not controlled by the
ASCII bit in the PSW.
But, That wasn't supposed to be a problem. IBM's USASCII-8 is different
from the ASCII we all know. There's a description of it in Appendix F of
360 Principles. The relationship between the two codes is that the high-
order bit of each 7-bit ASCII character is duplicated between bits 5 and 6
of the 7-bit character to form the 8-bit character. In other words, given
a 7-bit ASCII character
b7 b6 b5 b4 b3 b2 b1
The corresponding 8-bit USASCII-8 character is
b7 b6 b7 b5 b4 b3 b2 b1
This rearranges the code table as follows:
ASCII codes USASCII-8 codes characters
-------------- ----------------- -------------------------
00-1F (0-31) 00-1F (0-31) control chars (NUL-US)
20-3F (32-63) 40-5F (64-95) punctuation and digits
40-5F (64-95) A0-BF (160-191) upper case letters
60-7F (96-127) E0-FF (224-255) lower case letters
So the codes X'20' to X'22' were not assigned in USASCII-8, and are
usable as edit pattern characters with both that character set and
with EBCDIC. Of course, there are problems with using standard
ASCII characters in patterns since the special codes are assigned to
graph characters in regular ASCII.
Does this help put the topic to rest?
Hal Perkins UUCP: {decvax|vax135|...}!cornell!hal
Cornell Computer Science ARPA: hal at cornell BITNET: hal at crnlcs
More information about the Comp.unix
mailing list