fpc/tests/test/jvm/getbit.pp
Jonas Maebe 740e7ca6b5 + a bunch of jvm-specific tests: partly new, partly derived from existing
tests
   o currently not yet integrated in the makefile system, use testall.sh/
     testall.bat to run the tests

git-svn-id: branches/jvmbackend@18777 -
2011-08-20 08:35:11 +00:00

23 lines
335 B
ObjectPascal

program getbit;
{$mode delphi}
type
plint = class
digits: array of byte;
end;
function LGetBit(A: PLInt; Bit: Cardinal): Integer;
begin
Result := (A.Digits[(Bit - 1) shr 5 + 1] shr ((Bit - 1) and $1F{(Bit - 1) mod 32})) and 1;
end;
var
p: plint;
begin
p:=plint.create;
setlength(p.digits,10);
lgetbit(p,4);
end.