This problem seems to have a rather long history. I have been using SDCC
since 2.5.0 a couple of years ago and I noticed it then. Since this was
my first experience with serious programming and very first embedded, it
wasn't immediately clear whether this was a real problem or a
misunderstanding on my part. I'm surprised that this was not known before.
I have now moved up to a recent build (2.7.0#5000) and it has the same
problem. It seems to appear somewhat randomly, sometimes even after a
one line approach has been working for some time. Other edits in the
program will render a single line statement inoperative. The same
problem appears in all conditional type statements in addition to
'while' which should fit on one line; if, else, for, etc.
They're like magic, sometimes they work and sometimes they don't. :-)
Bobby
Maarten Brock wrote:
Hello Mike,
It seems like you discovered a bug. Would you be so kind as to open
a bug tracker item for it?
Thanks,
Maarten
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)
Assumption:
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?
Target:
mcs51
SDCC:
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)
{
BtRdl1;
}
}
Kind Regards, Mike
Mike Allsworth
Tel: +27 (0)11 794 5273
Cell: +27 (0)82 572 3079
email: [EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user