Longint、Longword、Shortint、Smallint、Int64
其中 Longint 相当于 Integer; Longword 相当于 Cardinal. 这样还有三种类型:
Shortint、Smallint、Int64
//Shortint 是1字节(8位)有符号整数
var
I: Shortint;
begin
//其最大值是: 011111112
asm
mov I, 01111111B
end;
ShowMessage(IntToStr(I)); {127}
//其最小值是: 100000002
asm
mov I, 10000000B
end;
ShowMessage(IntToStr(I)); {-128}
end;
//Smallint 是2字节(16位)有符号整数
var
I: Smallint;
begin
//其最大值是: 01111111 111111112
asm
mov I, 0111111111111111B
end;
ShowMessage(IntToStr(I)); {32767}
//其最小值是: 10000000 000000002
asm
mov I, 1000000000000000B
end;
ShowMessage(IntToStr(I)); {-32768}
end;
//Int64 是8字节(64位)的, 暂时的汇编知识, 我还测试不了它.