Debug: r (register)

Displays or alters the contents of one or more CPU registers. Used without parameters, the r command displays the contents of all registers and flags in the register storage area, the status of all flags, and the decoded form of the instruction at the current location.

Syntax

r [Register]

Parameters

Register : Specifies the name of the register containing the information you want to display.

?: Displays a list of debug subcommands.

Remarks

Windows XP does not use this command. It is accepted only for compatibility with MS-DOS files. 

Using the r subcommand

If you specify a register, Debug.exe displays the 16-bit value of that register in hexadecimal notation and displays a colon as the prompt. If you want to change the value contained in the register, type a new value and press ENTER. Otherwise, press ENTER to return to the debug prompt.

Valid x86 registers

The following table lists valid x86 registers for Register.

Value

ax

bp

bx

cs

cx

di

ds

dx

es

f

ip

pc

si

sp

ss

If you specify a register other than one from the preceding list, Debug.exe displays the following message:

br error

Using f instead of a register

If you type f instead of a register, Debug.exe displays the current setting of each flag as a two-letter code, and then displays the debug prompt. To change the setting of a flag, type the appropriate two-letter code from the following table.

Flag nameSetClear

Overflow

ov

nv

Direction

dn (decrement)

up (increment)

Interrupt

ei (enabled)

di (disabled)

Sign

ng (negative)

pl (positive)

Zero

zr

nz

Auxiliary Carry

ac

na

Parity

pe (even)

po (odd)

Carry

cy

nc

You can type new flag values in any order. You do not need to leave spaces between these values. To stop the r subcommand, press ENTER. Any flags for which you did not specify new values remain unchanged.

Messages displayed with the r subcommand

If you specify more than one value for a flag, Debug.exe displays the following message:

df error

If you specify a flag code not listed in the preceding table, Debug.exe displays the following message:

bf error

In both cases, Debug.exe ignores all settings specified after the invalid entry.

Default settings for Debug.exe

When you start Debug.exe, the segment registers are set to the bottom of free memory, the instruction pointer is set to 0100h, all flags are cleared, and the remaining registers are set to zero, except for sp, which is set to FFEEh.

For information about displaying the contents of a portion of memory by using the d subcommand, see Related Topics.

For information about disassembling bytes by using the u subcommand, see Related Topics.

Examples

If the current location is CS:11A, the display will look similar to the following:

AX=0E00 BX=00FF CX=0007 DX=01FF SP=039D BP=0000 SI=005C DI=0000 
DS=04BA ES=04BA SS=04BA CS=O4BA IP=011A NV UP DI NG NZ AC PE NC 
04BA:011A CD21 INT 21 

To view only the status of the flags, type:

rf

Debug.exe displays the information in the following format:

NV UP DI NG NZ AC PE NC - _

Type one or more valid flag values in any order, with or without spaces. For example:

nv up di ng nz ac pe nc - pleicy

Debug.exe stops the r subcommand and displays the debug prompt. To see the changes, type r or rf . Debug.exe displays the following:

NV UP EI PL NZ AC PE CY - _

Press ENTER to return to the debug prompt.

Formatting legend

FormatMeaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Debug subcommands

Debug

Debug: d (dump)

Debug: u (unassemble)

Command-line reference A-Z



© 2017 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies