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



bitmap is an array of chars.
cp is a pointer to a char.

bitmap[*cp++] means: the char from bitmap at index *cp++.  (C indexes are
0-relative, so bitmap[0] is the first char.)

*cp means: the char pointed to by cp.
The ++ after cp means: increment cp after using it to address a char.

So bitmap[*cp++] means: Extract the char from bitmap at the index equal to
the integer value of the char pointed to by cp.  Then increment cp by 1.

X << BitsAvail means: left shift X by BitsAvail bits (where BitsAvail is an
integer).

BitAcc |= X means: "or" X into BitAcc.  It's shorthand for BitAcc = BitAcc | X
where "|" is the "or" operator.

Here's MI that attempts to do the same thing:

         DCL SPCPTR CP        AUTO;
         DCL DD     C         CHAR(1) BAS(CP);
         DCL DD     BITMAP    CHAR(256) AUTO;
         DCL DD     CHAR4     CHAR(4) AUTO;
         DCL DD     BITSAVAIL UNSGND BIN(2) AUTO BDRY(2);
         DCL DD     UBIN4     UNSGND BIN(4) AUTO BDRY(4);
         DCL DD     BITACC    UNSGND BIN(4) AUTO BDRY(4);

         XOR(S)     CHAR4, CHAR4;
         XLATEWT    CHAR4(4:1), C, BITMAP;
         ADDSPP     CP, CP, 1;
         CPYBTLLS   UBIN4, CHAR4, BITSAVAIL;
         OR(S)      BITACC, UBIN4;

--Dave


On Saturday 15 December 2001 07:25, Harry Williarms wrote:
> Ok,
> The code I am stuck on is
> BitAcc |= bitmap[*cp++]<<BitsAvail;


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.