Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Decimal versus binary arithmetic was Re: J4 - presentation/discussion on "Future of the COB
On Wed, 2 Apr 2008 18:51:00 +0000 (UTC), docdwarf@panix.com () wrote:

>In article <WqCIj.292096$Gl5.205581@fe02.news.easynews.com>,
>William M. Klein <wmklein@nospam.netcom.com> wrote: 
>
>Given:
>
> WORKING-STORAGE SECTION.
>  01  NUMERATOR VALUE 1 COMP-5 PIC 9(9).
>  01  DENOMINATOR VALUE 5 COMP-5 PIC 9(9).
>  01  QUOTIENT COMP-5 PIC 9(9)V9(4).
>*
> PROCEDURE DIVISION.
>*
>     COMPUTE QUOTIENT = NUMERATOR / DENOMINATOR.
>     DISPLAY QUOTIENT.
>     GOBACK.
>
>... compiled with
>
>//COB      EXEC PGM=IGYCRCTL,
>//            PARM='SIZE(MAX),LIB,MAP,DYNAM,LIST,
>//             XREF,OPT,FLAG(I,I),NUMPROC(PFD),'
>
>... and using PP 5655-G53 IBM Enterprise COBOL for z/OS  3.4.1, the result
>I get is:
>
>000012  COMPUTE
>   0002B6  5840 912C               L     4,300(0,9)
>   0002BA  5830 4008               L     3,8(0,4)
>   0002BE  1F22                    SLR   2,2
>   0002C0  5870 4000               L     7,0(0,4)
>   0002C4  1F66                    SLR   6,6
>   0002C6  5D60 C000               D     6,0(0,12)
>   0002CA  4E70 D108               CVD   7,264(0,13)
>   0002CE  F154 D0FC D10B          MVO   252(6,13),267(5,13)
>   0002D4  4E60 D108               CVD   6,264(0,13)
>   0002D8  9110 D101               TM    257(13),X'10'
>   0002DC  D204 D101 D10B          MVC   257(5,13),267(13)
>   0002E2  4780 B0BE               BC    8,190(0,11)
>   0002E6  9601 D105               OI    261(13),X'01'
>   0002EA                 GN=15    EQU   *
>   0002EA  D203 D0F8 C008          MVC   248(4,13),8(12)
>   0002F0  F070 D0FE 0004          SRP   254(8,13),4(0),0
>   0002F6  5D20 C000               D     2,0(0,12)
>   0002FA  4E30 D118               CVD   3,280(0,13)
>   0002FE  F154 D108 D11B          MVO   264(6,13),283(5,13)
>   000304  4E20 D118               CVD   2,280(0,13)
>   000308  9110 D10D               TM    269(13),X'10'
>   00030C  D204 D10D D11B          MVC   269(5,13),283(13)
>   000312  4780 B0EE               BC    8,238(0,11)
>   000316  9601 D111               OI    273(13),X'01'
>   00031A                 GN=16    EQU   *
>   00031A  FDD5 D0F8 D10C          DP    248(14,13),268(6,13)
>   000320  F897 D120 D0F8          ZAP   288(10,13),248(8,13)
>   000326  960F D129               OI    297(13),X'0F'
>   00032A  D207 D118 A074          MVC   280(8,13),116(10)
>   000330  D204 D11B D125          MVC   283(5,13),293(13)
>   000336  4F20 D118               CVB   2,280(0,13)
>   00033A  F144 D11B D120          MVO   283(5,13),288(5,13)
>   000340  4F70 D118               CVB   7,280(0,13)
>   000344  5C60 C000               M     6,0(0,12)
>   000348  1E72                    ALR   7,2
>   00034A  47C0 B126               BC    12,294(0,11)
>   00034E  5A60 C004               A     6,4(0,12)
>   000352                 GN=17    EQU   *
>   000352  1222                    LTR   2,2
>   000354  47B0 B130               BC    11,304(0,11)
>   000358  5B60 C004               S     6,4(0,12)
>   00035C                 GN=18    EQU   *
>   00035C  9067 4010               STM   6,7,16(4)
>000013  DISPLAY

Obviously on an IBM z series system the last thing you want to do is
scaled arithmetic in binary.  This makes me even more curious to see
what gyrations are done by the p series compilers and any other
compilers which will show generated instructions for basically binary
only machines.  That code is SLOW.
>
>... so it would seem to ConVert to Decimal (0002CA, 0002D4, 0002FA,
>000304), Divide Packed (00031A), Zero and Add Packed (000320) and then
>Convert to Binary (000336, 000340)... along with a bunch of Other Stuff.
>
>(What comes next, of course, is Mr Klein's response along the lines of
>'How interesting... could you compile it again with options SNKRS, LNCHBAG
>and NWSPPR and post what that does?')
>
>DD

Clark Morris

Report this thread to moderator Post Follow-up to this message
Old Post
Clark F Morris
04-02-08 11:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:02 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.