Common instructions in assembly and usage of DTDebug

DTDebug

  • I won’t talk about the specific usage of DTDebug, you can search on the Internet
  • This is the interface diagram of an exe program opened by DTDebugD.
    Insert picture description here
    Let's talk about common assembly instructions in detail .

instruction

MOV instruction: is a very important instruction in assembly

MOV target operand, source operand
Function: Copy the source operand to the target operand
1. The source operand can be an immediate value, general register, segment register, or memory unit.
2. The destination operand can be a general register, a segment register or a memory unit
. 3. The width of the operand must be the same
. 4. The source operand and the destination operand cannot be a memory unit at the same time.
Insert picture description here
For your understanding, I will demonstrate the first syntax. You can Practice all the grammar in the picture above.
Pay attention to the picture below.
Insert picture description here
Now the program stays at the MOV, EAX, ECX statement and has not been executed yet. Let's press f8 in DTDebug to single-step debug and see the result

Insert picture description here
We found that the value in EAX has also become 0xBBBBBBBB. I
believe that everyone has understood the role of the mov instruction.

ADD instruction: is an addition instruction

ADD A, B
function: add A and B and put the added final value into A. The
syntax format is as shown in the figure below.
Insert picture description here
Here I will demonstrate the first grammar. You can demonstrate the grammar above.
Pay attention to the figure below.
Insert picture description here
Now the program stays at the ADD AL, CC statement, which has not been executed yet. We single-step debug by pressing f8 in DTDebug and look at the result.
Insert picture description here
At this time, we find that the value of AL has changed (note that AL is also part of EAX)

SUB instruction: is a subtraction instruction

SUB A, B
function: subtract the value of B from the value of A, and put the final value in A. The
syntax format is as follows.
Insert picture description here
Here I will demonstrate the first grammar. You can demonstrate the grammar above by yourself
. Pay attention to the figure below
Insert picture description here
Now the program stays at the MOV, EAX, ECX statement, and it has not been executed yet. We single-step debug by pressing f8 in DTDebug and look at the result.
Insert picture description here
After the subtraction is completed, the final value is placed in AL. 00

There are also several logical operation instructions

AND instruction, OR instruction, XOR instruction, NOT instruction.
If you want to know, you can search the Internet by yourself
. We will talk about these instructions later when we need them.

Guess you like

Origin blog.csdn.net/qq_51196205/article/details/109332962