IBM PC Architecture - Registers and Basic Instruction Execution in DEBUG


By adding to the DEBUG commands previously learned, it is possible to examine and modify the contents of registers, assemble and unassemble mnemonic operation codes, and execute program instructions in either a single-step or continuous mode. We can create complete, executable programs using DEBUG.

DEBUG Register Exploration

Using DEBUG with Assembly Language

Intel Assembler Operand Types

Note that although the following includes "labels" as valid "operand types", "labels" are not useable in DEBUG; these references are maintained here only for future use with true "assembler" programs (such as Arrow, MASM, or TASM).

reg
- any general or 8-bit register e.g. CX, DI, AL
reg8
- any 8 bit register e.g. BH, DL
reg16
- any (16-bit) general register e.g. AX, SI, BP
segreg
- any segment register e.g. CS, ES
mem
- a memory reference; possibly a label (not in DEBUG), an index or base register reference, a constant (in certain cases), a combination of the above (with optional segreg) e.g. TOTAL, [BX], TABL[BX], [ES:0080h], NUM+4 (again, note that labels are not available within DEBUG; you can only use register names and/or numbers).
regmem
- any general or 8-bit register or memory reference e.g. AH, CX, [DS:SI], COUNT
constant
- a constant expression e.g. 10h, 0, 'A', offset LABELX (not in DEBUG)
label (not in DEBUG)
- the label associated with a statement or data definition e.g. TOTAL, STEP_2

Some simple instructions (MOV, ADD, etc)

In the following with respect to flags set, only the Carry, Overflow, Sign and Zero flags will be considered.

MOV [destination],[source]
Flags: (none)
ADD [destination],[source]
Flags: Carry,Overflow,Sign,Zero
SUB [destination],[source]
Flags: Carry,Overflow,Sign,Zero

Assembly and Unassembly in DEBUG

Single Step Program Execution