I am new to c and keil. When I try to debug my code, this error message appeared. May anyone help me to find out where I got wrong? Thanks a lot.
Here is my code:
#include <reg51.h> #include "IOPort.h" unsigned char pulse1[]={9, 3, 6, 12}; unsigned char pulse2[]={2, 3}; unsigned char pulse3[]={0, 1};
delay(int d) {
int i; for (i=0;i<d;i++); }
forward () {
int j,c,no;
for (c=0;c<25;c++)
{
no=1;
for (j=no;j>=0;j--)
P1 = pulse2[j];
delay(1000);
}
main() {
forward(); }
It doesn't really matter what you wanted your program to do - you should still not let the program drop out of main(). The startup file _might_ have a jump so it restart your program again, and again, and again. Or there _might_ be an infinite loop that catches the execution. Or the processor _might_ start to run undefined instructions while plowing through the memory.
By the way - what answers did you find when you entered your error message in Google? Because, as you should be able to suspect, you aren't the first person who gets this error message...
Thanks for your reply. I really don't know a program need to be terminate. I think I should study how to use c language again. And, actually I had google it before, though I still can't figure out how to debug my code... I think the reason is that I don't have enough background knowledge. Again, thank you.