I want to run a short function from internal xdata!
I use the DS80C390, I use the configuration with my internal xdata on 00F000h–00FFFFh and no external xdata. I have 128k code space.
IDM = b00 P4CNT = b100
I have a byte array which I use to allocate space in the xdata range:
xdata tyu8 aru8Code[SIZE];
Here I copy my function to xdata:
tyu8 code* u8CodePtr; tyu8 u8Index = 0; for ( u8CodePtr = ((tyu8 code*) MyFunc); u8CodePtr < ((tyu8 code*) MyFunc+SIZE); u8CodePtr++, u8Index++ ) { aru8Code[u8Index] = *u8CodePtr; }
Here I want to call my function in xdata:
((void(*)(void)) aru8Code)();
Somehow it doesn't work, the processor restarts all the time. What am I missing?
READ
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer’s Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf