*** error 65: access violation at C:0x0100 : no 'execute/read' permission

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();
}

Parents
  • 1) Why didn't you post your source code tagged as source code? It was described clearly how to do it directly above the text input box.

    2) Your main() don't have an infinite loop at the end - where do you think your program will jump when it ends? Is it meaningful for a program in an embedded device to end? Is there any command line (CLI) or graphical interface (GUI) that will continue to run after your program ends? What is the processor expected to spend the rest of the time doing, until you power off your device?

    3) You never mention what processor you have, or what memory settings you have specified in the project settings.

Reply
  • 1) Why didn't you post your source code tagged as source code? It was described clearly how to do it directly above the text input box.

    2) Your main() don't have an infinite loop at the end - where do you think your program will jump when it ends? Is it meaningful for a program in an embedded device to end? Is there any command line (CLI) or graphical interface (GUI) that will continue to run after your program ends? What is the processor expected to spend the rest of the time doing, until you power off your device?

    3) You never mention what processor you have, or what memory settings you have specified in the project settings.

Children
More questions in this forum