| ??? 04/16/07 06:13 Read: times |
#137310 - Testing the typo... Responding to: ???'s previous message |
I tested the following code in the Keil Simulator, and it behaved as described by the OP - ie, P1 = 10 whatever the value of 'a': #include <REG8252.H>
void main(void)
{
float a;
a=5.34;
if( a > 1.2 )
P1=20;
else;
P1=10;
while(1);
}
It contains the typo suggested here: http://www.8052.com/forum/read.phtml?id=137189 So, presumably, the code the OP posted is not the actual code that he tested - but we'll have to wait for further information from Ajad Chhatkuli to be sure... |
| Topic | Author | Date |
| if else statements in keil c51 | 01/01/70 00:00 | |
| Things to check | 01/01/70 00:00 | |
| example | 01/01/70 00:00 | |
| And it might help to use hex | 01/01/70 00:00 | |
| floating point | 01/01/70 00:00 | |
| Not true | 01/01/70 00:00 | |
| further... | 01/01/70 00:00 | |
| I suggest you read this.. | 01/01/70 00:00 | |
| Test Seems To Work | 01/01/70 00:00 | |
| SDCC version works also | 01/01/70 00:00 | |
Testing the typo... | 01/01/70 00:00 | |
| its a lot easier to use fixed point | 01/01/70 00:00 |



