c51 的简单的计算为什么不对??
#include <stdio.h>
#include <aduc812.h>
main()
{
unsigned int a,b;
unsigned long z;
scon = 0x52; /* scon */ /* setup serial port control */
tmod = 0x20; /* tmod */ /* hardware (2400 baud @12mhz) */
tcon = 0x69; /* tcon */
th1 = 0xf3; /* th1 */
a=12345;
b=100;
z=(long)(a*b);
printf (" z=%ld\n",z);
}
结果应该是1234500;可是显示确是54852;?
发表时间:2003年7月1日15:06:08