Hi All,
Perhaps someone can help with the two functions shown below.
The scenario is:
   I desire to empty a hardware buffer, and just throw away it's contents.
   In both functions the requirement is to read BtRdl1 until the hardware device at this address shows empty as in (BtRdl1Stat & Rmpty)
   Just placing an identifier, BtRdl1, will cause it to be read.
The result:
   Function 1 does not work
   Function 2 does work
The question:
    Why does function 1 not work?
   C:\SDCC>sdcc -v
   SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.4 #5003 (Feb 11 2008) (MINGW32)
volatile __xdata uchar at (Bt8370_Base + 0xA8) BtRdl1;
volatile __xdata uchar at (Bt8370_Base + 0xA9) BtRdl1Stat;
#define Rmpty 0x04
Func 1
void l1_ClrBt8370_DL(void)
   while (BtRdl1Stat & Rmpty) BtRdl1;

Func 2
void l1_ClrBt8370_DL(void)
   while (BtRdl1Stat & Rmpty)
Kind Regards, Mike
Mike Allsworth
Tel: +27 (0)11 794 5273
Cell: +27 (0)82 572 3079
email: mandm@sentechsa.com