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 translating application to 0x8000 for debugging

I am trying to get Mon51 working at address 0x0000 in EPROM. Monitor is built with XDATA(XDATA_AREA(0D000H)), CODE(INITSEG(00000H)), INSTALLCODE(01000H).

Interrupt vectors are translated to 0x8000 except
the serial interrupt vector used by the monitor.

C:0x0000	020100	LJMP	C:0100
At C:0x0100 Code from Install.A51(InitSerial) runs
then
LJMP MON51 assembles as LJMP C:0546

C:0x0546	758107	MOV	SP(0x81),#0x07
C:0x0549	90D008	MOV	DPTR, #0xD008
C:0x054C	E4	CLR	A
C:0x054D	7805	MOV	R0,#05
C:0x054F	F0	MOVX	@DPTR,A
C:0x0550	A3	INC	DPTR
C:0x0551	8DFC	DJNZ	R0,C:054F
C:0x0553	7480	MOV	A,#P0(0x80)
C:0x0555	F0	MOVX	@DPTR,A
C:0x0556	A3	INC	DPTR
C:0x0557	7400	MOV	A,#0x00
C:0x0559	F0	MOVX	@DPTR,A
C:0x055A	A3	INC	DPTR
C:0x055B	7407	MOV	A,#0x07
C:0x055D	F0	MOVX	@DPTR,A
Executing this last step causes the debugger to pause for about 2 seconds, then the PC $= 0x8000
C:0x8000	LJMP	STARTUP1(C:9240)
This comes from STARTUP.A51 of my application which has a CSEG at 0x8000.

My target build has my application code starting at 0x9000.

At this point, I can start using the debugger correctly. I have full running, breakpoint, and debugging capability.

If I do not do the single stepping sequence up until the PC $ jumps to 0x8000 the debugger looses communications with the target, and a target reset is required. I cannot use the run until main() option.

Any help is appreciated.

0