ADuC7XXX系列为32bit的处理器,所以1个int类型数据会占用4个Byte。
下面给出在Keil UV3环境下,各种变量类型的数据长度和相应得取值范围:
数据类型
有符合/无符号
数据长度
取值范围
char
signed
8bits / 1Byte
-128 ~ +127
unsigned
8bits / 1Byte
0 ~ +255
short int
signed
16bits / 2Byte
-32768 ~ +32767
unsigned
16bits / 2Byte
0 ~ +65535
int
signed
32bits / 4Byte
-2147483648 ~ +2147483647
unsigned
32bits / 4Byte
0 ~ +4294967295
long int
signed
32bits / 4Byte
-2147483648 ~ +2147483647
unsigned
32bits / 4Byte
0 ~ +4294967295
float
32bits / 4Byte
+/-1.175494E-38 ~ +/-3.402823E+38
32bits / 4Byte
+/-1.175494E-38 ~ +/-3.402823E+38
double
32bits / 4Byte
+/-1.175494E-38 ~ +/-3.402823E+38
32bits / 4Byte
+/-1.175494E-38 ~ +/-3.402823E+38 |