hi all iam working on cygnal mcus .iam using i=5; do {i--; }while(i!=1); but this condition is not satisfying when i==1 ;iwant to exit at i=1 but its going in infinite loop kindly help me how to quitfrom this loop regards john e
I had similar problems, the most easyest things won't work. Often caused by data type confusion. Ensure that i has an integer type (NOT float) and is not altered by any interrupt routine. Take a look at the assembler code in the .lst file and try to understand what happens. regards, J Lehnhaueser
hi J Lehnhaeuser thanks for ur reply , actually still the loop is not exiting is there any exit commands in keil c regards john e
You need to look at the assembler.
"actually still the loop is not exiting is there any exit commands in keil c" JOHN e, You are displaying a serious lack of knowledge about very basic 'C'. I suggest you get a good 'C' book and invest some time learning 'C' before attempting to program the 8051 or you will fail to produce reliable code. Stefan