hello everyone, i am quite new to programming 8051..hoping to receive some help.. i have a pointer variable.The address stored in this variable resides in the on-chip XRAM.
unsigned char xdata *xloc;
i need the control of my program to be transferred to this address..how can it be done in C??? Thank You in advance for the help..
Then you first need to spend some time familiarising yourself with the architecture - there's a few ways in which it is quite different from others you may know:
www.8052.com/.../120112
http://www.8052.com/tutorial
"i need the control of my program to be transferred to this address"
What, exactly, do you mean by that?
Note that the 8051 architecture has separate Code and Data memory spaces...
there are certain opcodes that i've stored in the xdata space...the control of the program has to be transferred there...the system firmware is ofcourse stored in the code space,but this is a user-interactive project,something like a trainer kit...the user program memory is stored in the xdata space, to which i need to pass control....
So have you selected a chip - or implemented external hardware - that allows your device to map XDATA memory into the CODE data space?
If you haven't, then you are stuck having started to implement something you can't finish. The 8051 chip will only execute from CODE. So any "user-interactive project" that should allow someone to download applets to run just have to place that applet within CODE. Either with a chip that has IAP (In Application Programming), where you can reprogram some of the CODE flash memory. Or with a chip or external hardware that allows an area of XDATA and CODE to overlap so you can write your data to XDATA and then access it through CODE.
the '51 is harward architecture en.wikipedia.org/.../Harvard_architecture
the user program memory is stored in the xdata space, to which i need to pass control.
why do you think it's called XDATA?
Erik
8051 Basics Time:
The 8051 architecture can not execute instructions from anything other than CODE space.
Also, the 8051 archicture has no instruction to write to CODE space - the CODE space is strictly read-only.
Therefore, the only way to achieve this is by some proprietary extension - such as mapping memory into both CODE and XDATA spaces.
How have you achieved this?