Var
I:integer;
Begin
The integer type is a 4-byte (32-bit) signed integer, the highest digit is a sign bit, and if it is a positive number, the sign bit is 0, and the sign bit of the negative number is 1
So the maximum Integer value is: 01111111 11111111 11111111 111111112
asm
mov I, 01111111111111111111111111111111B;
end;
ShowMessage(IntToStr(I)); {2147483647}
The negative number of a signed integer equals the inverse code + 1 of the same positive number; The maximum Integer value is:
01111111 11111111 11111111 111111112; Its counter code is:
10000000 00000000 00000000 000000002; The counter code + 1 is after:
10000000 00000000 00000000 000000012
asm
mov I, 10000000000000000000000000000001B;
end;
ShowMessage(IntToStr(I)); {-2147483647}
What is the minimum value of the Integer?
Should be: 10000000 00000000 00000000 000000002
asm
mov I, 10000000000000000000000000000000B;
end;
ShowMessage(IntToStr(I)); {-2147483648}
11111111 11111111 11111111 111111112 is?
asm
mov I, 11111111111111111111111111111111B;
end;
ShowMessage(IntToStr(I)); {-1}
0 of the Integer type is in memory: 00000000 00000000 00000000 000000002
asm
mov I, 00000000000000000000000000000000B;
end;
ShowMessage(IntToStr(I)); {0}
The 10010 binary of the Integer type is: 00000000 00000000 00000000 011001002
asm
mov I, 00000000000000000000000001100100B;
end;
ShowMessage(IntToStr(I)); {100}
Calculate the Integer type-10010:
00000000 00000000 00000000 01100100 of the counter code is:
11111111 11111111 11111111 10011011; The counter code + 1 is after:
11111111 11111111 11111111 10011100
asm
mov I, 11111111111111111111111110011100B;
end;
ShowMessage(IntToStr(I)); {-100}
end;