D I G I T A L R E S E A R C H P. O. Box 579, Pacific Grove, CA 93950, (408) 649-3896 *** MP/M 1.0 *** Application Note #05 Debugging an XIOS or a Resident System Process ---------------------------------------------- An XIOS or a resident system process can be debugged using DDT or SID running under CP/M 1.4 or 2.0. The debugging technique is outlined in the following steps: 1.) Using GENSYS running under either CP/M or MP/M generate a MPM.SYS file which specifies the top of memory as 'C0'H. ... Top page of memory = C0 ... Also while executing GENSYS specify the breakpoint restart number as that used by the CP/M SID or DDT which you will be executing. This restart is usually #7. ... Breakpoint RST # = 7 ... 2.) If a resident system process is being debugged make certain that it is selected for inclusion in MPM.SYS. 3.) Using CP/M 1.4 or 2.0, load the MPMLDR.COM file into memory. A>DDT MPMLDR.COM DDT VERS 2.0 NEXT PC 1A00 0100 4.) Place a 'B' character into the second position of default FCB. This operation can be done with the 'I' command: -IB 5.) Execute the MPMLDR.COM program by entering a 'G' command: -G 6.) At point the MP/M loader will load the MP/M operating system into memory, displaying a memory map. MP/M 1.0 Application Note #05 (Cont'd) 7.) If you are debugging an XIOS, note the address of the XIOS.SPR memory segment. If you are debugging a resident system process, note the address of the resident system process. This address is the relative 0000H address of the code being debugged. You must also note the address of SYSTEM.DAT. 8.) Using the 'S' command, set the byte at SYSTEM.DAT + 2 to the restart number which you want the MP/M debugger to use. Do not select the same restart as that being used by the CP/M debugger. ... Memory Segment Table: SYSTEM DAT C000H 0100H ... -SC002 C002 07 05 9.) Using the 'X' command, determine the MP/M beginning execution address. The address is the first location past the current program counter. -X ....................... P = 08CD ..... 10.) Begin execution of MP/M using the 'G' command, specifying any breakpoints which you need in your code. Actual memory address can be determined using the 'H' command to add the code segment base address given in the memory map to the relative displacement address in your XIOS or resident system process listing. The following example shows how to set a breakpoint to debug an XIOS list subroutine: Given the following memory map- XIOS SPR B800H 0500H Begin MP/M execution with the following breakpoint- -G8CE,B80F 11.) At this point you have MP/M running with CP/M and its debugger also in memory. Since interrupts are left enabled during operation of the CP/M debugger when a breakpoint is reached, care must be taken to ensure that interrupt driven code does not execute through the point at which you have broken.