On Thu, May 20, 2010 at 08:52:37AM +0200, Jan Waclawek wrote: > This is IMHO a compiler error, you should perhaps submit it to the tracker. > > The immediate culprit is in what you've not shown, namely the declaration of > wiz_write8(), which I'd guess is > void wiz_write8(uint16_t, xdata uint8_t); >
void wiz_write8 (uint16 xdata addr, uint8 xdata wizdata); and passing in xdata to try and preserve DSEG space (which is the original reason for using medium-model, otherwise it runs out of DSEG). I've been proceeding via trial and error to get to the point of being able to compile in small model, but then it didn't run even when it compiled :-). I'll submit a bug with your test code (thanks for that!) and use medium-model til there is a fix. > The compiler is thus forced to pass the second parameter in xdata, and the > mechanism for that, as you've noticed, breaks the first parameter in dptr; so > I'd say you might be able to work this around by passing the second parameter > without the __xdata qualifier (eating up potentially direct adressable __data > space, though). > > Jan Waclawek > > PS. Just a sidenote: the comment in > wiz.h:#define Sn_IR(ch) WIZ_SOCK_REG(ch, 0x0002) /* 1 byte */ > lies - this is apparently an integer constant (i.e. 16 bit), which MAY be an > address of a byte. Yes, the 1 byte actually refers to the size of the register in the attached tcp engine not the pointer which is actually the lower 16 bits of the 24 bit pointer that gets to the tcp engine. Peter Van Epp ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user