HPlogo System Debug Reference Manual > Chapter 6 System Debug Command Specifications M-X

MR

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Modifies the contents of the specified CM or NM register.

Syntax



   MR cm_register [newvalue]
   MR nm_register [newvalue]

By default, the current register value is displayed. The ENV variable QUIET_MODIFY can be used to suppress the display of the current value.

Parameters


cm_register

The CM register whose contents are to be modified. This can be:

DB

The stack base relative word offset of DB.

DBDST

The DB data segment number.

CIR

The current instruction register.

CMPC

The full logical CM program counter address.

  • Only the offset part can be modified.

  • CIR will also be modified.

Q

The Q register word offset, DB relative.

S

The S register word offset, DB relative.

SDST

The stack data segment number.

STATUS

The CM status register.

  • The segment number portion cannot be modified.

X

The X (index) register.


NOTE: CM registers can not be modified when the user initially entered Debug in NM (nmdebug).

nm_register

The NM register whose contents are to be modified.


NOTE: NM registers can not be modified when the user initially entered Debug in CM (cmdebug).

Modifying PC modifies PCOF and PCSF. It sets PCOB to PCOF+4 and to PCSF. The original priv bits are retained. That is, when PC is modified, the priv bits are unaffected.

To fully understand the use and conventions for the various registers, refer to the Precision Architecture and Instruction Reference Manual and Procedure Calling Conventions Reference Manual. The procedure calling conventions manual is of particular importance for understanding how the language compilers utilize the registers to pass parameters, return values, and hold temporary values. The following tables list the NM registers available within System Debug. Many registers have aliases through which they may be referenced. Alias names in italics are not available in System Debug.

Access rights abbreviations are listed below. PM indicates that privileged mode (PM) capability is required.

d

Display access

D

PM display access

m

Modify access

M

PM modify access

The following registers are known as the General Registers.

Table 6-1 General Registers

Name Alias Access Description
ROnonedA constant 0
R1nonedmGeneral register 1
R2nonedmUsed to hold RP at times
R3nonedmGeneral register 3
[vellip]
R22nonedmGeneral register 22
R23ARG3dmArgument register 3
R24ARG2dmArgument register 2
R25ARG1dmArgument register 1
R26ARG0dmArgument register 0
R27DPdMGlobal data pointer
R28RET1dmReturn register 1
R29RET0dmReturn register 0
SLdmStatic link
R30SPdMCurrent stack pointer
R31MRPdmMillicode return pointer

The following registers are pseudo registers. They are not defined in the Precision Architecture, but are terms used in the Procedure Calling Conventions document and by the language compilers. They are provided for convenience. They are computed based on stack unwind information. They may not be modified.

Table 6-2 Pseudo Registers

Name Alias Access Description
RPnonedReturn pointer (not the same as R2)
PSPnonedPrevious stack pointer

The following registers are known as the Space Registers. They are used for short pointer addressing:

Table 6-3 Space Registers

Name Alias Access Description
SR0nonedmSpace register 0
SR1SARGdmSpace register argument
SRETdmSpace return register
SR2nonedmSpace register 2
SR3nonedmSpace register 3
SR4nonedMProcess local code space(tracks PC space)
SR5nonedMProcess local data space
SR6nonedMOperating system data space 1
SR7nonedMOperating system data space 2

The following registers are known as the Control Registers. They contain system state information:

Table 6-4 Control Registers

Name Alias Access Description
CR0RCTRdMRecovery counter
CR8PID1dMProtection ID 1 (16 bits)
CR9PID2dMProtection ID 2 (16 bits)
CR10CCRdMCoprocessor configuration (8 bits)
CR11SARdmShift amount register (5 bits)
CR12PID3dMProtection ID 3 (16 bits)
CR13PID4dMProtection ID 4 (16 bits)
CR14IVAdMInterrupt vector address
CR15EIEMdMExternal interrupt enable mask
CR16ITMRdMInterval timer
CR17PCSFdMPC space queue front
nonePCSBdMPC space queue back
CR18PCOFdMPC offset queue front
nonePCSBdMPC offset queue Back
nonePCQFdMPC queue (PCOF.PCSF) front
nonePCQBdMPC queue (PCOB.PCSB) back
nonePCdMPCQF with priv bits set to zero
nonePRIVdMLow two order bits (30,31) of PCOF.
CR19IIRdMInterrupt instruction register
CR20ISRdMInterrupt space register
CR21IORdMInterrupt offset register
CR22IPSWdMInterrupt processor status word
PSWdMProcessor status word
CR23EIRRdMExternal interrupt request register
CR24TR0dMTemporary register 0
[vellip]
CR31TR7dMTemporary register 7


NOTE: the Precision Architecture and Instruction Reference Manual refers to the PC (program counter) registers as the IA (instruction address) registers. This manual will use the PC mnemonic when referring to the IA registers.

The following registers are floating-point registers. If a machine has a floating-point coprocessor board, these values are from that board. If no floating-point hardware is present, the operating system emulates the function of the hardware, in which case these are the values from floating-point emulation.

Table 6-5 Floating Point Registers

Name Alias Access Description
FP0nonedmFP register 0
FP1nonedmFP register 1
FP2nonedmFP register 2
FP3nonedmFP register 3
FP4FARG0dmFP argument register 0
FRETdmFP return register
FP5FARG1dmFP argument register 1
FP6FARG2dmFP argument register 2
FP7FARG3dmFP argument register 3
FP8nonedmFP register 8
[vellip]
FP15nonedmFP register 15
FPSTATUSnonedmFP status reg (left half of FP0)
FPE1nonedmFP exception reg 1 (right half of FP0)
FPE2nonedmFP exception reg 2 (left half of FP1)
FPE3nonedmFP exception reg 3 (right half of FP1)
FPE4nonedmFP exception reg 4 (left half of FP2)
FPE5nonedmFP exception reg 5 (right half of FP2)
FPE6nonedmFP exception reg 6 (left half of FP3)
FPE7nonedmFP exception reg 7 (right half of FP3)

newvalue

The new value for the register can optionally be supplied on the command line. If the new value was omitted, Debug displays the old value, and prompts for the new value. To retain the original value, just hit return.

When a register is modified, the actual machine registers are not changed until the process is resumed. That is, the new value is recorded and takes effect when Debug is exited using the CONTINUE or EXIT commands. Furthermore the value is applied only to the PIN being debugged. This is true of all but several special registers that are expected to remain constant during the life of MPE XL. The list of these registers follows:

sR6

sR7

tr0-tr7

Alias for cr24 - cr31

cCr

Alias for cr10

iVa

Alias for cr14

eIem

Alias for cr15

eIrr

Alias for cr23

When one of these registers is modified, the new value takes effect immediately. Since these registers are global across all processes, all other users are affected by the change.

Examples



   %cmdebug > mr cmpc
CMPC=PROG %0.01754 := prog(0.1762)

Modify the contents of the CM program counter. Only the offset portion of the CM logical address can be modified. It is not possible to change the logical segment number portion.

Note that this also modifies CIR, the current instruction register.


   %cmdebug > mr x 0
   X=000123 := 0

Zero the X register.

   $nmdebug > mr pc pc + 4
   pc=0021d7b4 := 0021d7b8

Advance the PC (this changes pcq front and pcq back).

   $nmdebug > mr ret0  [psp-20]
   r28=00000001 := 00ef2340

Modify return register 0 (r28) to be the contents of the address specified by psp-20.

Limitations, Restrictions


The PC register can not be modified unless the user has privileged mode.

When CM code has been translated, and is executing translated, modification of the CM registers may result in an undefined/undesirable state.

Refer to appendix C for a discussion of CM object code translation, node points, and breakpoints in translated CM code.




MPSW


NM