Assembly language Overview

Source: Internet
Author: User

1.1  Machine Language

since to speak assembly language can not be mentioned machine languages, machine code is composed of 0 and 1 instruction sequence, the computer can directly execute machine code, so in machine language programming program execution speed, since this, So why do programmers now basically use machine language to write programs? Here is a program written in machine language, it should be easy to understand that the following code is a machine language written in a part of the program, is written on my HP machine:

         1011001010100101001101001010010010
0110010010100100101001010101010001
0010100110100000111001010101010100

now ask everyone: what is the function of this piece of code? I believe we can not understand it, in addition, if the program is not carefully written in the following program, please find this error:

         1011001010100101001101001010010010
0110010010100100101101010101010001
0010100110100000111001010101010100

Do you feel like crying without tears? This is just a very small piece of code, which is so troublesome, if a tens of thousands or even hundreds of thousands of lines of machine code, it is not to kill people, which exposes the machine language is obscure, difficult to modify maintenance shortcomings.

In addition, I have specifically emphasized in the previous The code written on the HP machine is not advertised for HP . This is emphasized because if I now put this program on another mac or other computer, this program will not work. Programmers write programs for everyone to serve, for the completion of the same function of the program, can not be written for each computer to write a version of it. The second drawback of machine language is that it is not portable.

See, machine language has such a serious flaw, I think only a fool will use it to write programs, this is the machine language almost disappeared reasons.

1.2  Assembly Language

Since machine language is so obscure, programmers need to remember a lot of machine instructions when writing programs and easy to remember, the development of the entire software industry has brought obstacles, but the human wisdom is infinite, people invented the assembly language, assembly instruction is the mnemonic of machine instruction, Each assembly instruction has a corresponding machine instruction, which is a great boon for programmers, who do not need to remember the boring 01 sequences.

The advent of assembly language does largely liberate programmers, but what we need to know is that computers only know 01 sequential columns, machine instructions, We do not know the assembly instructions we write, to enable the computer to perform the assembler we have written, there must be a "translation", to be able to translate our assembler program into the computer can recognize the execution of the machine code, the translation is "compiler." Of course, in the assembly code à machine code conversion process, and not only the compiler's credit, but also involves the linker and so on. is the process of converting assembler to executable machine code; This is an extremely complex process, not within the scope of this article, interested students can consult the relevant information.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4C/8D/wKiom1Q_33XDj4ZJAACY60KlQGw997.jpg "title=" 222222.png "alt=" Wkiom1q_33xdj4zjaacy60klqgw997.jpg "/>




This article is from "The Pony Blog" blog, please make sure to keep this source http://9501830.blog.51cto.com/9491830/1564965

Assembly language Overview

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.