×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Dennis,

There is more than one way to do that but you asked for the logical way:

http://graphics.stanford.edu/~seander/bithacks.html#SwappingValuesSubAdd

Paul Morgan

Principal Programmer Analyst
IT Supply Chain/Replenishment

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Dennis
Sent: Wednesday, October 19, 2011 11:04 AM
To: Midrange Systems Technical Discussion
Subject: Re: Executing an XORSTR in ILE?

On a mildly relevant track: not sure how widely known this is so I'll present a challenge: What are the three logical instructions that, when executed in order, will cause the values of A and B to be swapped, without need of a work area?
++
Dennis
++
"If I had my life to live again, I'd make the same mistakes, only sooner."
-- Tallulah Bankhead



Sent from my Galaxy tablet phone. Please excuse my brevity.
For any grammatic/spelling errors, there is no excuse.
++


"Jon Paris" <jon.paris@xxxxxxxxxxxxxx> wrote:

I thought the answer given to this question was that RPG's %BITAND,
%BITOR, %BITXOR, and %BITNOT were probably a a better approach than
trying to use XORSTR?


On Oct 18, 2011, at 3:41 PM, midrange-l-request@xxxxxxxxxxxx wrote:

I have a single XORSTR instruction that I would like to be able to
call in an ILE environment.

Jon Paris

www.partner400.com
www.SystemiDeveloper.com




--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.