Introduction to assembly Language (Edit and debug programs in Debug)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.