× 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: Bitwise ops in RPG
  • From: Douglas Handy <dhandy1@xxxxxxxxxxxxx>
  • Date: Wed, 15 Nov 2000 12:23:54 -0500

Jim,

>Could someone please point to the documentation on the Bitwise MI
>instructions with perhaps a line or two on how to use them?  Thanks.

Here is a quote from Barbara Morris, posted in response to a question from Jim
Willsher over a year ago on comp.sys.ibm.as400.misc:

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

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.