|
Joe, Off the top of my head, I doubt there is a C function to do this as it is an op-code integral to C. However, you could roll your own C procedure and call that from RPG. HTH, Charles Wilt iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joe Pluta > Sent: Tuesday, March 22, 2005 10:11 AM > To: 'RPG programming on the AS400 / iSeries' > Subject: Bitwise and and or > > > I'm currently trying to do some bitwise arithmetic at V5R1. Something > along these lines: > > ALIGN_MASK c x'C000' > ALIGN_LEFT c x'8000' > ALIGN_RIGHT c x'4000' > ALIGN_CENTER c x'C000' > > Now, I want to check a variable called "flags". In Java, it's pretty > easy: > > if ((flags & ALIGN_MASK) == ALIGN_LEFT) > > And in later versions of RPG, I can use the %BITAND BIF. For > V5R1, what > do you all suggest? I can do something close using BITOFF, but for > anything more than one byte (8 bits) it's a lot of work. > > Is there perhaps a C function that ANDs two values? I'm just fishing > here so I don't have to write my own test routines. > > Joe > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) > mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.