From: Klaus F. <kla...@gm...> - 2003-07-19 22:41:35
|
Hi, it seems that the DS390/DS400 Port has a problem, when a function pointer is to be saved in a sloc. In this case the operand type is set to immediate value (AOP_IMMD) instead of an pointer (AOP_DPTR). I wrote a little patch that fixes this problem, but i'm not sure if i did it the right way. Perhaps one of the developers could have a look at this. Thanks, Klaus P.S.: Sorry for bad english > Hello, > > i'm having some trouble with the following code: > > > struct mbr_t { > unsigned char something[510]; > unsigned int magic; > }; > > struct drive_t { > unsigned char (*read)(unsigned char, void xdata*, unsigned long, > unsigned char) reentrant; > unsigned char handle; > }; > > struct drive_t xdata *drives[4]; > struct mbr_t xdata *mbrs[4]; > > void media_inserted(unsigned char di) > { > unsigned char i; > > i = drives[di]->handle; > > (*drives[di]->read)(i, mbrs[di], 0, 1); > > if (mbrs[di]->magic != 0xaa55) > return; > } > > > if i compile it with > sdcc -mds400 -c test.c > or: sdcc -mds390 -c test.c > > i get this error: > test.c:23: error: FATAL Compiler Internal Error in file 'gen.c' line > number '1514' : aopPut got unsupported aop->type > Contact Author with source code > > SDCC : mcs51/gbz80/z80/avr/ds390/pic14/pic16/TININative/xa51/ds400 > 2.3.5 (Jul 12 2003) (UNIX) > > > |