• Aucun résultat trouvé

ON-LINE DEBUGGING

Dans le document THE 1600 (Page 77-80)

STRO&e

2.1 RESIDENT FIRMWARE

2.1.2 ON-LINE DEBUGGING

The On-Line Debug Program (OOP), an integral component of the resident firmware, aids in rapid debugging of CP1600 programs by providing the follow-ing capabilities: Display and/or modify CPU registers, status word, memory and I/O device registers; search and initialize memory; program breakpoints and relocation origins and modifications of branch and jump instruction destin-ations.

Program execution may be suspended and control returned to OOP during pro-gram debugging in order to inspect registers, memory, etc. by setting break-points. Up to eight program breakpoints may be set shnultaneously, each of which causes OOP to insert a SIN instruction at the specified address and save the original instruction. When a SIN is executed, an interrupt is generated which causes program control to be returned to OOP and the address of the ex-ecuted SIN to be saved. Upon entry, OOP scans its table of active breakpoints to determine if entry is due to a breakpoint. If a breakpoint caused entry,

"Br@ataaaa" is typed to inform the user which program breakpoint was reached.

OOP then removes all active breakpoints so that the program is restored to its original state, i. e., no SIN instructions before interaction with the user via the monitor is resumed. When the user enters a continue command indicating the program execution is to be resumed at the current breakpOint, OOP checks for an active breakpoint entry, rejecting the command if no breakpoint entry is acti\{'!o OOP then analyzes the breakpointed instruction and CPU status to determine

which instruction after the breakpointed instruction will be executed. The in-struction is saved, a SIN inserted at this address and the breakpointed instruc-tion restored. Program control is then transferred to the restored breakpointed instruction, causing the CPU to execute it and the hnmediately trap back to OOP because of the SIN at the next instruction address. The breakpointed instruction is then saved again, a SIN inserted, the continuation restored and program exe-cution resumed. Thus, whenever the user is interacting with OOP, the program environment is undistlmbed and the instructions at breakpoints may be changed before execution continues. There are no restrictions on breakpoint placement except that the breakpoint address must be at the first word of a multi -word in-struction. If a SIN entry is unknown, i. e., not a breakpoint or the user has not defined a trap address, "T@aaaaa ?" is displayed indicating that an unknown trap from address aaaaa caused entry. In this case all active breakpoints are remo\{'!d from the program and interaction with the user via the monitor initiated. A sub-sequent continue command, however, will be rejected because a valid breakpoint did not cause entry.

Although there are no restrictions on breakpoint placement, continuation from

75

a breakpointed BEXT instruction or from most instructions which alter the contents of register 7, the program counter, is not permitted. Con-tinuation is, however, provided for from breakpointed PULR PC (MVI R6, R&), JR Rn (MOVR Rn, R7) and MVII i, R7 instructions.

Program development and debugging efforts can be minimized by using modular programming techniques. CP1600 software enables the user to separate a pro-gram into logical sections or modules conveniently. These modules may be assembled separately and then linked together, relocated, and loaded prior to execution. ODP enables the user to reference addresses within a module rela -.

tive to its assembly base address by setting an Origin to the relocated module base address. The user is thus relieved of the task of computing relocation addresses during debugging. An address may be expressed relative to Origin n(0-7) by entering the address value in the following format: On+a. For ex-ample, if Origin 3 is set to 2053, 03+16 specifies address 2071. Addressing may be specified in this fasion in any command which contains address speci-fication(s) .

When ODP is processing a comrriam which results in extended output on the tele-type, such as display addresses and search address, the user can cancel the activity by depressing the "CTRL" key while striking the "C" key. This causes the activity to be canceled and another command prompt

"$"

to be displayed.

In the following command description& required items are underlined and

"i"

represents a carriage return.

Command

$1c ... c!

$!:!:J

$Bn,

aJ,

$B,

all

$Bnl

$B,t

$CnJ - ...

$DAl,.hl.

$DB,t-$ooj

-Function Commentary.

Inspect/modify contents of address a.

Set breakpoint n (0-7) at address a.

Set next available breakPoint at address a.

Remove breakpoint n (0-7).

Remove all breakpoints.

Continue execution from current breakpoint (n times).

Display contents of addresses 1 to h inclusive.

Display active breakpoints.

Display active origins.

76

Command

$DR»-$DT~

$Ea~

$lA1, h,

v, m,i

$Mlh,bt

$On, ai

$~

$On.J-$Qj

$Rn~

$~

$SA1, h, v,

ml

Function

Display contents of registers 0-7 and status word.

Display current SIN trap vectoT address.

Execute at address a, if no address is specified the current value of R7 is used.

Initialize the contents of addresses 1 to h inclusive to value v using mask m. If no mask is specified, 177777 is used.

Modify the branch instruction at address a for destin-ation address b,

Modify the jurrp instruction at address a for destination address b.

Set origin n (0-7) to address a.

Set next available origin to address a.

Remove origin n (0-7).

Remove all origins.

Inspect/modify contents of register n (0-7).

Single step instruction at address a, if no address i specified the current value to R7 is used.

Search address 1 to h inclusive for value v using mask m.

The mask is used to extract the corresponding bits from the contents of each address before the comparison with the value takes place. If no mask is specified, 177777 is used.

Inspect/modify status word.

Trap to address a, i. e., set SIN trap rector address.

Deactivate SIN trap vector.

77

Dans le document THE 1600 (Page 77-80)

Documents relatifs