comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Thompson <david.thompson1@worldnet.att.net>
Subject: Re: What about big integers in Ada 2005?
Date: Mon, 10 Oct 2005 05:36:02 GMT
Date: 2005-10-10T05:36:02+00:00	[thread overview]
Message-ID: <bpujk1998r48p79n5jh1jtfgm42jl3ei8r@4ax.com> (raw)
In-Reply-To: ofA0f.9445$6e1.2100@newssvr14.news.prodigy.com

On Tue, 04 Oct 2005 18:56:20 GMT, <adaworks@sbcglobal.net> wrote:
<snip>
> BCD was originally a six bit (where 7 was a parity bit) representation.  With
> the advent of the byte on the IBM System 360, BCD became Extended Binary
> Coded Decimal Interchange Code (EBCDIC).
> 
The 6-bit character code was BCDIC -- Binary Coded Decimal Interchange
Code.  With the advent of _8-bit_ bytes on S/360 it became EBCDIC.

BCD was/is any representation that uses 4-bits for each decimal digit,
hence the name. That can be an outright 4-bit processor like the
original 4004; 4-bits in a 6-bit (BCDIC) or 8-bit (EBCDIC) or 7-bit
(ASCII) character; or 2 4-bit nibbles packed in an 8-bit byte.

> In COBOL for the 360, we had several Picture clauses available.
> 
>      05 Item-1       PICTURE   XXX .            which would be represented by
> EBCDIC
>      05 Number     PICTURE   S99999.         which would also be EBCDIC
>      05 Hnumber   PICTURE   S99999 Usage Comp-3. which would be packed
> 
> decimal.
> 
> COMP-3 represented the numeric PICTURE by using a half-byte (nibble) for each 9
> in the picture and a nibble for the sign.   In the example shown, Hnumber would
> occupy
> only three bytes where Number would occupy five bytes.   In both cases, the
> high-order
> nibble is used for the sign.
> 
Not that last; the S/360 decimal instructions (AP, SP, etc.) put the
sign in the low-order nibble, namely the low half of the highest
addressed byte, which is the low-valued one on big-endian S/360.

For DISPLAY numeric the sign is in the high nibble aka 'zone' of _one_
byte, IIRC the low-order (high-address) one by default but you can
specify SIGN [IS] LEADING | TRAILING .

> There are actually some additional formats available including USAGE
> COMPUTATIONAL
> which is the same as representing a value in pure binary within the size of a
> word.
> 
Pure binary, but IIRC fullword or halfword depending on digits.

And [DISPLAY] numeric with SIGN ... [IS] SEPARATE a full byte for each
digit _plus_ one for sign.  (And numeric edited even more, but that's
no longer just a number representation anyway.)

> I could write for a couple of hours on this topic, but I think this gets the
> gist of the issue.
> 
> The central problem is that business data processing people use all of these
> formats
> at one time or another.
> 

- David.Thompson1 at worldnet.att.net



  reply	other threads:[~2005-10-10  5:36 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15 17:06 What about big integers in Ada 2005? jtg
2005-09-15 17:26 ` Pascal Obry
2005-09-15 17:30   ` Martin Dowie
2005-09-15 17:26 ` Martin Krischik
2005-09-15 19:37   ` Martin Dowie
2005-09-15 21:08     ` Larry Kilgallen
2005-09-15 20:33   ` jtg
2005-09-15 21:10     ` Larry Kilgallen
2005-09-18  0:46   ` adaworks
2005-09-30 17:41     ` Robert A Duff
2005-09-30 20:18       ` Jeffrey R. Carter
2005-10-02  0:27       ` adaworks
     [not found]         ` <imsuj1h8vevg4un71rmh0nc41pnee5ihjl@4ax.com>
2005-10-02 10:33           ` Martin Krischik
2005-10-02 16:20             ` adaworks
2005-10-04  5:24           ` adaworks
2005-10-04  7:22             ` tmoran
2005-10-04  8:25             ` Dmitry A. Kazakov
2005-10-04 11:57               ` Simon Clubley
2005-10-04 16:10                 ` Robert A Duff
2005-10-04 17:24                   ` Simon Clubley
2005-10-04 19:44                     ` Robert A Duff
2005-10-04 13:46               ` adaworks
2005-10-04 16:38                 ` Robert A Duff
2005-10-04 16:52                   ` Martin Dowie
2005-10-04 17:16                     ` Robert A Duff
2005-10-04 13:50               ` adaworks
2005-10-04 14:59                 ` Larry Kilgallen
2005-10-04 16:03                 ` Robert A Duff
2005-10-04 18:56                   ` adaworks
2005-10-10  5:36                     ` Dave Thompson [this message]
2005-10-14  0:31                       ` adaworks
2005-10-06 14:21             ` Adrian Hoe
2005-10-07  6:48               ` Martin Krischik
2005-10-02  0:48   ` Brian May
2005-10-02 10:28     ` Martin Krischik
2005-10-02 10:52       ` Brian May
2005-10-02 15:12       ` Simon Wright
2005-10-02 17:11         ` Martin Dowie
2005-09-16 14:33 ` gautier_niouzes
2005-09-17  3:43   ` Craig Carey <research@ijs.co.nz>
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox