📄 td_asm.txt
字号:
language is Assembler,
[ES:DI],20m
specifies that you want to look at a raw hex memory dump of the 20 bytes
pointed to by the ES:DI register pair.
Source-level debugging
======================
You can step through your assembler code using a Module window just as
with any of the high-level languages. If you want to see the register
values, you can put a Registers window to the right of the Module window.
Sometimes, you may want to use a CPU window and see your source code as
well. To do this, open a CPU window and choose the Code pane's Mixed
command until it reads Both. That way you can see both your source code
and machine code bytes. Remember to zoom the CPU window (by pressing F5)
if you want to see the machine code bytes.
Examining and changing registers
================================
The obvious way to change registers is to highlight a register in either
a CPU window or Registers window. A quick way to change a register is to
choose Data|Evaluate/Modify. You can enter an assignment expression that
directly modifies a register's contents. For example,
SI = 99
loads the SI register with 99.
Likewise, you can examine registers using the same technique. For example,
Alt-D E AX
shows you the value of the AX register.
=========================================
5. Inline assembler keywords
=========================================
This section lists the instruction mnemonics and other special symbols that
you use when entering instructions with the inline assembler. The keywords
presented here are the same as those used by Turbo Assembler.
8086/80186/80286 instructional mnemonics
_________________________________________
AAA INC LIDT** REPNZ
AAD INSB* LLDT** REPZ
AAM INSW* LMSW** RET
AAS INT LOCK REFT
ADC INTO LODSB ROL
ADD IRET LODSW ROR
AND JB LOOP SAHF
ARPL** JBE LOOPNZ SAR
BOUND* JCXZ LOOPZ SBB
CALL JE LSL** SCASB
CLC JL LTR** SCASW
CLD JLE MOV SGDT**
CLI JMP MOVSB SHL
CLTS** JNB MOVSW SHR
CMC JNBE MUL SLDT**
CMP JNE NEG SMSW**
CMPSB JNLE NOP STC
CMPSW JNO NOT STD
CWD JNP OR STI
DAA JO OUT STOSB
DAS JP OUTSB STOSW
DEC JS OUTSW STR**
DIV LAHF POP SUB
ENTER* LAR** POPA* TEST
ESC LDS POPF WAIT
HLT LEA PUSH VERR**
IDIV LEAVE PUSHA* VERW**
IMUL LES PUSHF XCHG
IN LGDT** RCL XLAT
XOR
___________________________________________
* Available only when running on the 186 and 286 processor
** Available only when running on the 286 processor
Turbo Debugger supports all 80386 and 80387 instruction
mnemonics and registers:
80386 instruction mnemonics
_________________________________________
BSF LSS SETG SETS
BSR MOVSX SETL SHLD
BT MOVZX SETLE SHRD
BTC POPAD SETNB CMPSD
BTR POPFD SETNE STOSD
BTS PUSHAD SETNL LODSD
CDQ PUSHFD SETNO MOVSD
CWDE SETA SETNP SCASD
IRETD SETB SETNS INSD
LFS SETBE SETO OUTSD
LGS SETE SETP JECXZ
__________________________________________
80486 instruction mnemonics
_________________________________________
BSWAP INVLPG
CMPXCHG WBINVD
INVD XADD
_________________________________________
80386 registers
_________________________________________
EAX EDI
EBX EBP
ECX ESP
EDX FS
ESI GS
_________________________________________
CPU registers
__________________________________________________________________
Byte registers AH, AL, BH, BL, CH, CL, DH, DL
Word registers AX, BX, CX, DX, SI, DI, SP, BP, FLAGS
Segment registers CS, DS, ES, SS
Floating registers ST, ST(0), ST(1), ST(2), ST(3), ST(4),
ST(5), ST(6), ST(7)
___________________________________________________________________
Special keywords
_________________________________________
WORD PTR TBYTE PTR
BYTE PTR NEAR
DWORD PTR FAR
QWORD PTR SHORT
_________________________________________
8087/80287 numeric coprocessor instruction mnemonics
____________________________________________________
FABS FIADD FLDL2E FST
FADD FIACOM FLDL2T FSTCW
FADDP FIACOMP FLDPI FSTENV
FBLD FIDIV FLDZ FSTP
FBSTP FIDIVR FLD1 FSTSW**
FCHS FILD FMUL FSUB
FCLEX FIMUL FMULP FSUBP
FCOM FINCSTP FNOP FSUBR
FCOMP FINIT FNSTS** FSUBRP
FCOMPP FIST FPATAN FTST
FDECSTP FISTP FPREM FWAIT
FDISI FISUB FPTAN FXAM
FDIV FISUBR FRNDINT FXCH
FDIVP FLD FSAVENT FXTRACT
FDIVR FLDCWR FSCALE FYL2X
FDIVRP FLDENV FSETPM* FYL2XPI
FENI FLDLG2 FSQRT F2XM1
FFREE FLDLN2
_____________________________________________________
* Available only when running on the 287 numeric coprocessor.
** On the 80287, the fstsw instruction can use the AX register as an
operand, as well as the normal memory operand.
80387 instruction mnemonics
_________________________________________
FCOS FUCOM
FSIN FUCOMP
FPREM1 FUCOMPP
FSINCOS
_________________________________________
The 80x87 coprocessor chip and emulator
=======================================
This section is for programmers who are familiar with the operation
if the 80x87 math coprocessor. If your program uses floating-point
numbers, Turbo Debugger lets you examine and change the state of the numeric
coprocessor or, if the coprocessor is emulated, examine the state of the
software emulator. (Windows permits you only to examine the state of the
emulator, not to change it.) You don't need to use the capabilities
described in this chapter to debug programs that use floating-point numbers,
although some very subtle bugs may be easier to find.
In this section, we discuss the differences between the 80x87 chip and
the software emulator. We also describe the Numeric Processor window and
show you how to examine and modify the floating-point registers, the status
bits, and the control bits.
The 80x87 chip vs. the emulator
===============================
TDW automatically detects whether your program is using the math chip or the
emulator and adjusts its behavior accordingly.
Note that most programs use either the emulator or the math chip, not both
within the same program. If you have written special assembler code that
uses both, TDW won't be able to show you the status of the math chip; it
reports on the emulator only.
=========================================
6. The Numeric Processor window
=========================================
You create a Numeric Processor window by choosing the View|Numeric Processor
command from the menu bar. The line at the top of the window shows the
current instruction pointer, opcode, and data pointer. The instruction
pointer is both shown as a 20-bit physical address. The data pointer is
either a 16-bit or a 20-bit address, depending on the memory model. You
can convert 20-bit addresses to segment and offset form by using the first
four digits as the segment value and the last digit as the offset value.
For example, if the top line shows IPTR=5A669, you can treat this as the
address 5a66:9 if you want to examine the current data and instruction in
a CPU window. This window has three panes: The left pane (Register pane)
shows the contents of the floating-point registers, the middle pane
(Control pane) shows the control flags, and the right pane (Status pane)
shows the status flags.
The top line shows you the following information about the last floating-
point operation that was executed:
o Emulator indicates that the numeric processor is being emulated. If there
were a numeric processor, 8087, 80287, 80387, or 80486 would appear instead.
o The IPTR shows the 20-bit physical address from which the last floating-
point instruction was fetched.
o The OPCODE shows the instruction type that was fetched.
o The OPTR shows the 16-bit or 20-bit physical address of the memory address
that the instruction referenced, if any.
The Register pane
-----------------
The 80-bit floating-point registers
-----------------------------------
The Register pane shows each of the floating-point registers, ST(0) to
ST(7), along with its status (valid/zero/special/empty). The contents
are shown as an 80-bit floating-point number.
If you've zoomed the Numeric Processor window (by pressing F5) or made
it wider by using Window|Size/Move, you'll also see the floating-point
registers displayed as raw hex bytes.
The Register pane's local menu
------------------------------
___________
| Zero |
| Empty |
| Change... |
|___________|
To bring up the Register pane local menu, press Alt-F10, or use the Ctrl
key with the first letter of the desired command to directly access the
command.
Zero
----
Sets the value of the currently highlighted register to zero.
Empty
-----
Sets the value of the currently highlighted register to empty. This is a
special status that indicates that the register no longer contains valid
data.
Change
------
Loads a new value into the currently highlighted register. You are
prompted for the value to load. You can enter an integer or floating-
point value, using the current language's expression parser. The value
you enter is automatically converted to the 80-bit temporary real format
used by the numeric coprocessor.
You can also invoke this command by simply starting to type the new value
for the floating-point register. A dialog box appears, exactly as if you
had specified the Change command.
The Control pane
----------------
The control bits
----------------
The following table lists the different control flags and how they
appear in the Control pane:
_________________________________________
Name in pane Flag description__
im Invalid operation mask
dm Denormalized operand mask
zm Zero divide mask
om Overflow mask
um Underflow mask
pm Precision mask
iem Interrupt enable mask (8087 only)
pc Precision control
rc Rounding control
ic Infinity control__
The Control pane's local menu
-----------------------------
________
| Toggle |
|________|
Press Tab to go to the Control pane, then press Alt-F10 to pop up the
local menu. (Alternatively, you can use the Ctrl key with the first letter
of the desired command to access it.)
Toggle
------
Cycles through the values that the currently highlighted control flag
can be set to. Most flags can only be set or cleared (0 or 1), so this
command just toggles the flag to the other value. Some other flags have
more than two values; for those flags, this command increments the flag
value until the maximum value is reached, and then sets it back to zero.
You can also toggle the control flag values by highlighting them and
pressing Enter.
The Status pane
---------------
The status bits
---------------
The following table lists the different status flags and how they appear
in the Status pane:
____________________________________
Name in pane Flag description__
ie Invalid operation
de Denormalized operand
ze Zero divide
oe Overflow
ue Underflow
pe Precision
ir Interrupt request
cc Condition code
st Stack top pointer_
The Status pane's local menu
----------------------------
________
| Toggle |
|________|
Press Tab to move to the Statuspane, then press Alt-F10 to pop up the
local menu. (You can also use the Ctrl key with the first letter of the
desired command to access the command directly.)
Toggle
------
Cycles through the values that the currently highlighted status flag
can be set to. Most flags can only be set or cleared (0 or 1), so this
command just toggles the flag to the other value. Some other flags have
more than two values; for those flags, this command increments the
flag value until the maximum value is reached, and then sets it back to
zero.
You can also toggle the status flag values by highlighting them and
pressing Enter.
/***************************** END OF FILE *******************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -