#define
APE_TAG_FLAG_CONTAINS_FOOTER
(1 << 30)
which suggests bit 30 is also used as a one-bit
flag. But whether this is in the same word or not can't necessarily be
determined from the #defines. You'll probably need to find the code that
masks, sets and tests these fields to be sure how they're used, for example
look for something like:
value = (word &
TAG_FIELD_FLAG_DATA_TYPE_MASK) >> 1;
to extract the value of the field from the
word;
or, to set the value to, say "External
Info":
word &=
~TAG_FIELD_FLAG_DATA_TYPE_MASK;
word |=
TAG_FIELD_FLAG_DATA_TYPE_EXTERNAL_INFO;
To achieve the same operations in Delphi, use the
bitwise logical operators not, and, or, xor, shl and shr. Snipped from the
help screen:
The following logical operators perform bitwise manipulation on integer
operands. For example, if the value stored in X (in binary) is 001101 and the
value stored in Y is 100001, the statement
Z := X or Y;
assigns the value 101101 to Z.
| Operator
| Operation
| Operand types
| Result type
| Examples
|
| not
| bitwise negation
| integer
| integer
| not X
|
| and
| bitwise and
| integer
| integer
| X and Y
|
| or
| bitwise or
| integer
| integer
| X or Y
|
| xor
| bitwise xor
| integer
| integer
| X xor Y
|
| shl
| bitwise shift left
| integer
| integer
| X shl 2
|
| shr
| bitwise shift right
| integer
| integer
| Y shl I |
The following rules apply to bitwise
operators.
The result of a not operation is of the same type
as the operand.
If the operands of an and, or, or xor operation are
both integers, the result is of the predefined integer type with the smallest
range that includes all possible values of both types.
The operations
x shl y and x shr y shift the value of x to the left or right by y bits, which
is equivalent to multiplying or dividing x by 2^y; the result is of the same
type as x
. For example, if N stores the value 01101 (decimal 13), then N
shl 1 returns 11010 (decimal 26).