We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm new to embedded c programming... I have an error *** error 65: access violation at C:0x0300 : no 'execute/read' permission*** while running the following program.... can anyone clarify my doubt...
Program:
#include <reg51.h> void main(void) { unsigned char z; z=P1; z=z&0x3; switch (z) { case(0): { P0=0; break; } case(1): { P0=1; break; } case(2): { P0=2; break; } case(3): { P0=3; break; } } }
There are many questions about that code. Anyway.
Just one question. What do YOU think the processor is doing, when it returns from main()? This is the first severe error some people do, when starting with embedded programming.
.
THAT IS ALMOST DEFENITILY THE WRONG ANSWER.
I "DEFENITILY" CAN'T SPELL.
First of all, read the Tips for Posting Messages. The next time you ignore them people will be offended.
Look at your syntax for swtich/case. It's very unusual. I don't know whether it's syntactically invalid (I think not), but it betrays a certain ignorance of what the statements do. Clean it up, before doing anything else.
but are good at SHOUTING
Erik