@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/bit.texi,v 1.2 1999/12/21 02:47:33 noro Exp $ \BJP @node bit 演算,,, 組み込み函数 @section bit 演算 \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 演算 \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 ごとの and \EG :: bitwise and @item ior(@var{i1},@var{i2}) \JP :: bit ごとの or \EG :: bitwise or @item ixor(@var{i1},@var{i2}) \JP :: bit ごとの xor \EG :: bitwise xor @end table @table @var @item return \JP 整数 \EG integer @item i1,i2 \JP 整数 \EG integer @end table @itemize @bullet \BJP @item 整数 @var{i1}, @var{i2} の絶対値を bit 列とみて演算する. @item 引数の符号は無視し, 非負の値を返す. \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 参照 \EG @item References @fref{ishift}. @end table \JP @node ishift,,, bit 演算 \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 整数 \EG integer @item i,count \JP 整数 \EG integer @end table @itemize @bullet \BJP @item 整数 @var{i} の絶対値を bit 列とみて shift する. @item @var{i} の符号は無視し, 非負の値を返す. @item @var{count} が正ならば右 shift, 負ならば左 shift を行う. \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 参照 \EG @item References @fref{iand ior ixor}. @end table