R [[register[[[[=]]expression]]]]
register
Change the contents of the given register. If omitted, displays the values of all registers and flags and the current machine instruction.
[[=]]expression
Assign the value of the expression to the specified register. The equal sign (=) is optional; a space has the same effect.
The Register (R) command displays and changes the values in the CPU registers. To display register contents without changing them, type the Register (R) command without any arguments. This form of the command shows the current values of all registers and flags. Flags are shown symbolically. It also shows the current instruction at the address given by CS:IP.
If an operand of the instruction contains memory expressions or immediate data, CodeView evaluates the operand and indicates the value to the right of the instruction. This value is referred to as the “effective address” and is also displayed at the bottom of the Register window.
You can use the R command to change the values in CPU registers. Also, you can change the bits in the flag register symbolically without having to compute a value of the register.
Changing Register Values
To change the value in a register:
1.Type the command letter R followed by the name of a register. The register name can be any of the following: AX, BX, CX, DX, CS, DS, SS, ES, SP, BP, SI, DI, IP, or FL (for flags). If you have a 80386/486-based machine and the 386 option is turned on, the register name can be one of the 32-bit register names: EAX, EBX, ECX, EDX, ESP, EBP, ESI, or EDI.
Note:
CodeView allows you to load different execution models which may specify a certain set of registers. For example, the valid registers in the p-code model are DS, SS, CS, IP, SP, BP, PQ, TH, and TL.
2.CodeView displays the current value of the register and prompts for a new value with a colon (:).
If you only want to examine the value, press ENTER.
If you want to change the value, type an expression (in the current radix) for the value and press ENTER.
As an alternative, you can use the Display Expression (?) command to change the value in a register:
?register=expression
Changing Flag Values
To change a flag value:
1.Type the command letter R followed by the letters FL.
2.The command displays the value of each flag as a two-letter name. At the end of the list of values, the command prompts for new flags with a dash (–).
3.Type the new values after the dash for the flags you wish to change, then press ENTER.
You can enter flag values in any order. If you do not enter a new value for a flag, it remains unchanged.
If you do not want to change any flags, press ENTER.
Note:
If you enter an illegal flag name, CodeView displays an error message. The flags preceding the error are changed; flags at and following the error are not changed.
The flag values are:
Flag | Set Symbol | Clear Symbol |
Overflow | OV | NV |
Direction | DN | UP |
Interrupt | EI | DI |
Sign | NG | PL |
Zero | ZR | NZ |
Auxiliary carry | AC | NA |
Parity | PE | PO |
Carry | CY | NC |
As an alternative to typing the R command, you can use the Register window to display CPU values. To change CPU values with the Register window, type over the old values.
In the following example, the R command displays the current registers and CPU flags. Then the R command changes the value in the AX register.
>R
AX=0005 BX=299E CX=0000 DX=0000 SP=3800 BP=380E SI=0070 DI=40D1
DS=5067 ES=5067 SS=5067 CS=4684 IP=014F
NV UP EI PL NZ NA PO NC
0047:014F 8B5E06 lea di,[BP+06] ss:ff38=299E
>R AX
AX 0005
:3
>