From: Nick Craig-W. <nc...@ax...> - 2003-07-01 09:34:04
|
On Tue, Jul 01, 2003 at 10:45:12AM +1200, Simon Hosie wrote: > Nick Craig-Wood: > > u8 eeprom_read(u16 address) > > { > > (void)address; > > _asm > > clr _EA > > clr _EEPROM_DISABLE > > movx a,@dptr > > setb _EEPROM_DISABLE > > setb _EA > > mov dpl, a > > _endasm; > > } > > > > Which generates this new warning > > > > hardware.c:163: warning: function 'eeprom_read' must return value > > How about: > > return DPL; > > or > > return ACC; > > And check that it gets optimised appropriately. That's how I used > to handle the same problem in Borland C. return DPL generates mov dpl, _DPL which isn't ideal, but return ACC (and deleting the last assembler line above) works perfectly. A fine solution thank you! -- Nick Craig-Wood nc...@ax... |