This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem regarding printf

My program is as follows:

void main(void)
{
	char far *ptr;

	ptr = 0x200000;
	printf("ptr = %p\r\n", ptr);
	while(1);
}
I simulate it with Keil debugger, the result is as follows:
#1 After executing "ptr = 0x210000;",
in Watch & Call Stack Window-Locals subwindow,
I see the value of ptr is ????????;

#2 Step over "printf"
Popup Disassembly Window, PC = C:0x1F0130(the entry point of printf)
Output Window "error 65: access violation at X:0x400003 : no 'write' permission"

#3 Click "Step Over" several times
Popup Disassembly Window, PC = C:0x000000
Output Window "error 65: access violation at X:0x400006 : no 'write' permission"
Output Window "error 65: access violation at X:0x400004 : no 'read' permission"

#4 I have my program run in application board, result is normal!

Other information:
CPU = DS80C400
FREQ = 11.0592MHz
Contiguous Mode: 16MB
Off-chip code memory: 0x1F0000(start), 0x10000(length)
Off-chip xdata memory: 0x200000(start), 0x10000(length)
Enable "far memory type support"
Enable LX51 & AX51
Startup file: startup400.a51(from DALLAS SEMI)

Parents Reply Children
No data