2013-06-02 17:09 4252 People read Comments (2) favorite reports Classification:assembly Language (1)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
We enter the DOS mode in Windows, is actually virtual 8086 mode dos, by clicking "Start", "Run", enter "command", click "OK", you can see a black box pop up, and then, in the black box to enter the relevant information, (in advance to say, Assembly language is not sensitive to capitalization, while C is case sensitive):
Here is a detailed analysis:
1. Debug is a debugging tool (although you can write a program in debug, but really want to write assembler, rarely write in debug)
2. R for querying the values of each register
3. A is used to enter assembly instructions
4. T used to execute a assembly instruction
5. There are other orders, such as D, E and so on, do not introduce here, when used, check the OK
The starting point for 6.CPU execution is the CS:IP place
7.debug Write program, MOV ax, 1 in 1 represents 0001h, verify as follows:
Next, let's look at a program:
Here is a brief analysis:
1. Stack is SS:SP, that is, 1000:0100
2. Push represents the stack
3. Pop indicates the stack
4. According to the nature of the stack: AX and BX value Exchange
There is one more problem to solve: in the above process, is the T command to execute the program, can only execute one at a time, that there is no command to fully execute the program? Yes! And look at the use of the G command:
For some people, can not see the program, do not see the operation, you can not see what you want to see, to understand the above several small programs, the assembly language has a preliminary understanding, do not start on the boundless theory.
Although basic operation and code is simple (easy to be despised by the so-called assembly language Daniel), but undoubtedly, the simplest thing usually has the biggest straightforward sex. Getting Started, everything is a cinch.
Introduction to assembly Language (Edit and debug programs in Debug)