Size of long on the intel 386 is 64bits. On the msp430, it is 32bits. Try long long Garst
walt spicker wrote: > > Hello, > > I'm having trouble with the following pointer math. I get a different > result from the MSP430 GCC when I execute the same code compiled with > GCC for intel 386. Here is an example: > > unsigned long *p1=(void*)0x1000, *p2=(void*)0x7000, *p3=(void*)0xf000; > unsigned long p2p1 = p2-p1; > unsigned long p3p1 = p3-p1; > static char buf[30]; > snprintf (buf, sizeof(buf), "%8.8lx %8.8lx", p2p1, p3p1); > PrintLine (buf); > > The "PrintLine" function squirts the string out my serial port that I > feed to my terminal emulator for display. The resulting string is given > below. > > 00001800 fffff800