From: raveendra_ibm on

Hi Richard,

I wonder if there is any sort of conversion from unpacked to packed
format. But I believe zero'ing the zone bits would result in 134N but
it gives 134E as the answer.

The sample code is here...

A PIC X(04) VALUE IS 'KLMN'.
B REDEFINES A PIC S9(04).
ADD 1000 TO B.
DISPLAY B.

Could you please explain me the equivalent assembler code corresponding
to this.

Thanks and Regards,
Raveendra.


--
raveendra_ibm
Message posted via http://www.exforsys.com for all your training needs.

From: on
In article <raveendra_ibm.21dekg(a)no-mx.forums.yourdomain.com.au>,
raveendra_ibm <raveendra_ibm.21dekg(a)no-mx.forums.yourdomain.com.au> wrote:
>
>Hi Richard,
>
>I wonder if there is any sort of conversion from unpacked to packed
>format.

Do your own homework, please.

DD
From: epc8 on

raveendra_ibm wrote:
> Hi Richard,
>
> I wonder if there is any sort of conversion from unpacked to packed
> format. But I believe zero'ing the zone bits would result in 134N but
> it gives 134E as the answer.
>
> The sample code is here...
>
> A PIC X(04) VALUE IS 'KLMN'.
> B REDEFINES A PIC S9(04).
> ADD 1000 TO B.
> DISPLAY B.
>
> Could you please explain me the equivalent assembler code corresponding
> to this.
>
> Thanks and Regards,
> Raveendra.
>

Why not post this question in the newsgroup "comp.lang.asm370"? They
could use some message traffic. <grin>

BTW, both of your samples output 134N using the old Cobol650 compiler.
(This runs on the PC and uses the ASCII equivalents of the expected
EBCDIC characters for zoned decimals.)

-- Elliot

From: HeyBub on
Robert Jones wrote:
> Richard wrote:
>>> A PIC X(04) VALUE IS 'BCDN'.
>>> B REDEFINES A PIC S9(04).
>>> ADD 1000 TO B.
>>> DISPLAY B.
>>
>>> Could you please let me know how this conversion from unpacked to
>>> packed decimal is ...
>>
>> It _isn't_ packed. There is no 'unpacked to packed conversion'. It is
>> all unpacked. The only 'conversion' is that the zone bits are
>> zeroised.
>
> I was under the impression that all arithmetic on display values in an
> IBM mainframe environment involved conversion to packed decimal and
> back. I don't know about other platforms.

Your impression is wrong. Way wrong.

I got my start on a 360-44. It didn't even HAVE storage-to-storage
operations (such as add packed or move character). To this day,
register-to-register operations are binary, as they were from the beginning.


From: Binyamin Dissen on
On Mon, 9 Jan 2006 08:28:55 -0500 raveendra_ibm
<raveendra_ibm.21dekg(a)no-mx.forums.yourdomain.com.au> wrote:

:>I wonder if there is any sort of conversion from unpacked to packed
:>format. But I believe zero'ing the zone bits would result in 134N but
:>it gives 134E as the answer.

:>The sample code is here...

:>A PIC X(04) VALUE IS 'KLMN'.
:>B REDEFINES A PIC S9(04).
:>ADD 1000 TO B.
:>DISPLAY B.

:>Could you please explain me the equivalent assembler code corresponding
:>to this.

I would expect COBOL to generate:

PACK WorkField(at least 5),B
AP WorkField(at least 5),literal-packed-1000
UNPK B,Last-three-bytes-of-WorkField

There may be an intermediate workfield on the UNPK.

--
Binyamin Dissen <bdissen(a)dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: Tandem
Next: free implementation? factorial?