3 ms·
370 Assembly had a machine operation for converting an EBCDIC-encoded digit string into an internal integer which seemed odd at the time, but the more I think a
by dhosek 4y ago
370 Assembly had a machine operation for converting an EBCDIC-encoded digit string into an internal integer which seemed odd at the time, but the more I think about it (converting digit strings to integers is a surprisingly subtle operation), the more it makes sense to do this at the lowest level possible.
The other interesting thing about EBCDIC was that character codes with A–F in the lower nibble of the code were generally unused or reserved for uncommon characters. This restriction didn’t apply to the upper nibble (most notably the digits were encoded as F0–F9).
- jasomill 4y agoThat's not unusual for a CISC instruction set; even x86 has rudimentary decimal (BCD and ASCII) arithmetic support. Modern z/Architecture (64-bit 360/370/390 successor) has instructions to convert numbers between EBCDIC, ASCII, Unicode, packed decimal, zoned decimal, and binary, and to convert Unicode character strings between UTF-8, UTF-16, and UTF-32. In addition to conversion instructions, z/Architecture has full arithmetic support for binary and decimal integer operations and binary, decimal, and hexadecimal floating-point. POWER6 and later instruction sets also include full support for decimal floating-point.
- karmakaze 4y agoI assumed that packed decimals operations were already supported in old processors. E.g. COBOL had the 9(7)V9(2) implied-decimal-point style of money format that was well supported. Or do you mean all operations and not only conversion and basic + - * /.
- Smoosh 4y ago"A program running on z/OS and the zSeries mainframe can run with 24-, 31-, or 64-bit addressing (and can switch among these if needed)." https://www.ibm.com/docs/en/cics-ts/5.4?topic=basics-24-bit-31-bit-64-bit-addressing https://www.ibm.com/docs/en/cics-ts/5.4?topic=basics-24-bit-...