The Watcom Debugger defines a number of symbols that have special meanings. This appendix describes the the following:
Each of the registers is designated by a special name.
eax | 32-bit EAX register (32-bit mode only) |
ax | 16-bit AX register |
al | 8-bit AL register |
ah | 8-bit AH register |
ebx | 32-bit EBX register (32-bit mode only) |
bx | 16-bit BX register |
bl | 8-bit BL register |
bh | 8-bit BH register |
ecx | 32-bit ECX register (32-bit mode only) |
cx | 16-bit CX register |
cl | 8-bit CL register |
ch | 8-bit CH register |
edx | 32-bit EDX register (32-bit mode only) |
dx | 16-bit DX register |
dl | 8-bit DL register |
dh | 8-bit DH register |
eip | Instruction pointer register (32-bit mode only) |
ip | Instruction pointer register |
esi | Source index register (32-bit mode only) |
si | Source index register |
edi | Destination index register (32-bit mode only) |
di | Destination index register |
esp | Stack pointer register (32-bit mode only) |
sp | Stack pointer register |
ebp | Base pointer register (32-bit mode only) |
bp | Base pointer register |
cs | Code segment register |
ds | Data segment register |
es | Extra segment register |
fs | Segment register (32-bit mode only) |
gs | Segment register (32-bit mode only) |
ss | Stack segment register |
fl | Flags register |
efl | Flags register (32-bit mode only) |
You can identify the bits in the Flags and Extended Flags registers, as shown in the following table:
Flags | EFlags | Description |
---|---|---|
fl.o | efl.o | overflow flag |
fl.d | efl.d | direction flag |
fl.i | efl.i | interrupt flag |
fl.s | efl.s | sign flag |
fl.z | efl.z | zero flag |
fl.a | efl.a | auxiliary carry flag |
fl.p | efl.p | parity flag |
fl.c | efl.c | carry flag |
The following symbols access the registers, control word, and status word of the math coprocessor:
You can identify the bits of the control word, as follows:
You can identify the individual bits of the status word, as follows:
000 = register 0 is stack top 001 = register 1 is stack top 010 = register 2 is stack top . . . 111 = register 7 is stack top
The debugger permits you to manipulate register contents using any of the operators described in the Expression Handling chapter. By default, these predefined names are accessed just like any other variables that you or the application have defined.
Should the situation ever arise where the application defines a variable whose name conflicts with that of one of these debugger variables, the module specifier _dbg may be used to refer to the symbol defined by the debugger rather than the one defined by the application.
For example, if the application defines a variable called cs, then you must use _dbg@cs to refer to the Code Segment register.
The flags register, the 8087 control word, and the 8087 status word can be accessed as a whole or by its component status bits. For example:
/fl.c=0 /cw.um=0 ?sw.oe
In the above example, the ``carry'' flag is cleared, the 8087 underflow mask of the control word is cleared, and the 8087 overflow exception bit of the status word is printed.
The low-order bit of the expression's result is used to set or clear the specified flag. For example:
fl.c=0x03a6
In the above example, the ``carry'' flag is cleared since the low-order bit of the result is 0.
The debugger also defines some other special names:
For example:
? dbg$bp
? dbg$ip
? dbg$sp