File: [local] / OpenXM / src / asir-doc / parts / builtin / bit.texi (download)
Revision 1.3, Sat Apr 19 15:44:58 2003 UTC (21 years, 4 months ago) by noro
Branch: MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9 Changes since 1.2: +3 -3
lines
Still updating the manula.
|
@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/bit.texi,v 1.3 2003/04/19 15:44:58 noro Exp $
\BJP
@node bit $B1i;;(B,,, $BAH$_9~$_H!?t(B
@section bit $B1i;;(B
\E
\BEG
@node Bit operations,,, Built-in Function
@section Bit operations
\E
@menu
* iand ior ixor::
* ishift::
@end menu
\JP @node iand ior ixor,,, bit $B1i;;(B
\EG @node iand ior ixor,,, Bit operations
@subsection @code{iand}, @code{ior}, @code{ixor}
@findex iand
@findex ior
@findex ixor
@table @t
@item iand(@var{i1},@var{i2})
\JP :: bit $B$4$H$N(B and
\EG :: bitwise and
@item ior(@var{i1},@var{i2})
\JP :: bit $B$4$H$N(B or
\EG :: bitwise or
@item ixor(@var{i1},@var{i2})
\JP :: bit $B$4$H$N(B xor
\EG :: bitwise xor
@end table
@table @var
@item return
\JP $B@0?t(B
\EG integer
@item i1 i2
\JP $B@0?t(B
\EG integer
@end table
@itemize @bullet
\BJP
@item
$B@0?t(B @var{i1}, @var{i2} $B$N@dBPCM$r(B bit $BNs$H$_$F1i;;$9$k(B.
@item
$B0z?t$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B.
\E
\BEG
@item
The absolute value of the argument is regarded as a bit string.
@item
The sign of the argument is ignored and a non-negative integer is returned.
\E
@end itemize
@example
[0] ctrl("hex",1);
0x1
[1] iand(0xeeeeeeeeeeeeeeee,0x2984723234812312312);
0x4622224802202202
[2] ior(0xa0a0a0a0a0a0a0a0,0xb0c0b0b0b0b0b0b);
0xabacabababababab
[3] ixor(0xfffffffffff,0x234234234234);
0x2cbdcbdcbdcb
@end example
@table @t
\JP @item $B;2>H(B
\EG @item References
@fref{ishift}.
@end table
\JP @node ishift,,, bit $B1i;;(B
\EG @node ishift,,, Bit operations
@subsection @code{ishift}
@findex ishift
@table @t
@item ishift(@var{i},@var{count})
:: bit shift
@end table
@table @var
@item return
\JP $B@0?t(B
\EG integer
@item i count
\JP $B@0?t(B
\EG integer
@end table
@itemize @bullet
\BJP
@item
$B@0?t(B @var{i} $B$N@dBPCM$r(B bit $BNs$H$_$F(B shift $B$9$k(B.
@item
@var{i} $B$NId9f$OL5;k$7(B, $BHsIi$NCM$rJV$9(B.
@item
@var{count} $B$,@5$J$i$P1&(B shift, $BIi$J$i$P:8(B shift $B$r9T$&(B.
\E
\BEG
@item
The absolute value of @var{i} is regarded as a bit string.
@item
The sign of @var{i} is ignored and a non-negative integer is returned.
@item
If @var{count} is positive, then @var{i} is shifted to the right.
If @var{count} is negative, then @var{i} is shifted to the left.
\E
@end itemize
@example
[0] ctrl("hex",1);
0x1
[1] ishift(0x1000000,12);
0x1000
[2] ishift(0x1000,-12);
0x1000000
[3] ixor(0x1248,ishift(1,-16)-1);
@end example
@table @t
\JP @item $B;2>H(B
\EG @item References
@fref{iand ior ixor}.
@end table