{———————————————————————————————————————————————————————————————————————————————
-255~0的integer数化为二进制补码
————————————————————————————————————————————————————————————————————————————————}
function IntToBinComplement(num: integer):string;
var
x, i: integer;
binX, binY: string;
begin
binY:= '';
x:= (-1)* num;
binX:= intToBin(x, 8);
for i := 2 to 8 do
begin
if copy(binX,i,1)='0' then
begin
binY:= binY + '1';
end
else if copy(binX,i,1)='1' then
begin
binY:= binY + '0';
end;
end;
x:= BinToInt(binY) + 1;
binX:= '1' + IntToBin(x, 7);
Result:= binX;
end;