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



"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 12/19/2016
09:21:38 PM:
If you use ILE CL (CLLE) vs. OPM CL (CLP), then you can use many MI
instructions directly "in-line" as built-in functions. This includes
the MI instructions for testing and setting individual bits, etc.

Although I am using CLLE and although I have coded assembler
programs for many years for mainframes, I have never used an MI
instruction on AS/400, iSeries, or IBM i. So, I wouldn't even know what
that looks like in-line in a CLLE program. Hints? I'm already converting
a byte to 8 bits the long way in a CL subroutine, but it seems painful to
do it this way. ;-)

...snip...

CHGVAR VAR(&CHAR) VALUE(%SST(&RCVR 9 1))
CALLSUBR SUBR(GET_BITS)

IF COND(&BIT_2_ON) THEN(CHGVAR &FILEATRB *LF)
ELSE CMD(CHGVAR &FILEATRB *PF)
IF COND(&BIT_4_ON) THEN(CHGVAR &FILETYPE *SRC)
ELSE CMD(CHGVAR &FILEATRB *DATA)

...snip...

SUBR SUBR(GET_BITS)
CHGVAR VAR(&BYTVALUE) VALUE(&CHAR)
CHGVAR VAR(&DECVALUE) VALUE(&HALFWORD)
CHGVAR VAR(&BIT_ADDR) VALUE(%ADDR(&BIT_7_ON))
DOFOR VAR(&BIT_POS) FROM(7) TO(0) BY(-1)
CHGVAR VAR(&TMPVALUE) VALUE(&DECVALUE / 2)
CHGVAR VAR(&BIT) VALUE(&DECVALUE - (&TMPVALUE * 2))
CHGVAR VAR(&BIT_ON) VALUE(&BIT *EQ 1)
CHGVAR VAR(&DECVALUE) VALUE(&DECVALUE / 2)
CHGVAR VAR(%OFFSET(&BIT_ADDR)) +
VALUE(%OFFSET(&BIT_ADDR) - 1)
ENDDO
ENDSUBR

Sincerely,

Dave Clark

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.