× 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.



Hi,
When I was browsing through RPG mailing list archives for XOR operation, I 
came accross with the following posting from Barbara Morris.
Anybody ever used it ?
If yes, could i have a sample code?
Thanks in advance for any help.
Ali


Jim, from RPG IV you can use the MI builtin _XORSTR.  Here's a prototype 
for the
most general way you can call it, passing the addresses of your result and 
the
values you want to xor.  You could also prototype it with the first three
parameters having type say 1A, or 10U 0 (passed by reference for the first
parameter, passed by CONST for the second and third) if you always have 
the same
type of data.
 
D xorstr          PR                  EXTPROC('_XORSTR') 
D  result                        *  VALUE
D  bits1                          *  VALUE
D  bits2                          *  VALUE
D  len_in_bytes                10u 0 VALUE 
 
Fyi, you can use _ANDSTR and _ORSTR (same call interface) for bitwise an 
and or.
Bitwise negation can be done x XOR X'FFFFFFFF'.
 
Barbara Morris

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.