Register command

Purpose: The Register command has three functions:

■ It displays the hexadecimal contents of a single regi-
ster, with the option of changing those contents.

■ It displays the hexadecimal contents of all the regi-
sters, plus the alphabetic flag settings, and the next
instruction to be executed.

■ It displays the eight 2-letter alphabetic flag settings,
with the option of changing any or all of them.

Format: R [registername]

Remarks: When the DEBUG program starts, the registers and flags are
set to certain values for the program being debugged (see
Starting DEBUG).

Display a single register

The valid registernames are:

AX BP SS
BX SI CS
CX DI IP
DX DS PC
SP ES F

Both IP and PC (program counter) refer to the instruction
pointer.

For example, to display the contents of a single register,
you might enter:

R AX

The system might respond with:

AX F1E4
:_

Now you may take one of two actions:

■ Press Enter to leave the contents unchanged.
or
■ Change the contents of the AX register by entering a
1-4 character hexadecimal value, such as 0FFFh.

AX F1E4
:FFF_

Now pressing Enter changes the contents of the AX register
to 0FFFh.


Display all registers and flags

To display the contents of all registers and flags (and the
next instruction to be executed), type:

R

The system might respond with:

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

The first two lines display the hex contents of the registers
and the eight alphabetic flag settings. The last line indi-
cates the location of the next instruction to be executed,
and its hex and unassembled formats. This is the instruction
pointed to by CS:IP.


Display all flags

There are eight flags, each with 2-letter codes to indicate
either a set or clear condition.

The flags appear in displays in the same order as presented
in the following table:


Flag Name Set Clear
Overflow (yes/no) OV NV
Direction (decrement/increment) DN UP (DowN/UP)
Interrupt (enable/disable) EI DI
Sign (negative/positive) NG PL (NeG/PLus)
Zero (yes/no) ZR NZ
Auxiliary carry (yes/no) AC NA
Parity (even/odd) PE PO
Carry (yes/no) CY NC


To display all flags, enter:

R F

If all the flags are in a set condition, the response is:

OV DN EI NG ZR AC PE CY -_

Now you can take one of two actions:

1. Press Enter to leave the settings unchanged.
2. Change any or all of the settings.

To change a flag, just enter its opposite code. The opposite
codes can be entered in any order - with or without interven-
ing spaces. For example, to change the first, third, fifth,
and seventh flags, enter:

OV DN EI NG ZR AC PE CY - PONZDINV

They are entered in reverse order in this example.

Press Enter and the flags are modified as specified, the
prompt appears, and you can enter the next command.

If you want to see if the new codes are in effect, enter:

R F

The response is:

NV DN DI NG NZ AC PO CY -_

The first, third, fifth, and seventh flags are changed as
requested. The second, fourth, sixth, and eighth flags are
unchanged.

Note:
A single flag can be changed only once per R F command.