× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: MOVE and Z-ADD are **NOT**THE**SAME** (was Z-ADD or Eval?)
  • From: "jt" <jt@xxxxxx>
  • Date: Wed, 23 Aug 2000 17:40:19 -0400
  • Importance: Normal

Barbara,

I agree with everything you said.

My comment was only regarding Jim Langston's original question which was
specifically about MOVE/Z-ADD of *ZEROS.

jt

-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On
Behalf Of bmorris@ca.ibm.com
Sent: Wednesday, August 23, 2000 12:58 PM
To: RPG400-L@midrange.com
Subject: Re: MOVE and Z-ADD are **NOT**THE**SAME** (was Z-ADD or Eval?)



>Date: Tue, 22 Aug 2000 15:44:28 -0500 (CDT)
>From: Scott Klement <klemscot@klements.com>
>
>Ummm...  why would Z-Add be more efficient than MOVE? That seems odd to
>me.  Math is slower than just moving bytes around...

>Date: Tue, 22 Aug 2000 19:05:29 -0400
>From: "jt" <jt@ee.net>
>
>I was always told that, on the S/38, MOVE and Z-ADD created the exact same
>MI instruction.  I verified this is still true today by looking at the IRP
>from an RPG compile by specifying GENOPT(*LIST).  Both use the same MI
>instruction 'copy numeric value 0.0 to field X':
>
>CPYNV X,P'0.0'

MOVE between numerics is not usually just a matter of moving bytes around.
Also it's not the same as Z-Add.

This: MOVE  123.45   P    7 4
doesn't do the same thing as
this: Z-ADD 123.45   P    7 4

Sure, the same code is generated for Z-ADD *ZEROS and MOVE *ZEROS.  And
maybe even occasionally for other MOVE/Z-ADD pairs. But in general, MOVE
and Z-ADD don't generate the same code because they don't mean the same
thing.  Try my code above.  Also, check the results.  Set P to 999.9999
before you do the Z-ADD or the MOVE.

Barbara Morris

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.