The need to learn assembly language

1, EDITORIAL

Assembly language programming as a mainstream language of their own is unrealistic, when the code reaches a certain extent, to maintain the code becomes difficult, or even impossible.

But we still have to learn assembly language, but learning assembly purpose is not to use it to carry out real programming, but full access to the machine running the program and a deep understanding of the mechanism underlying programming experience.

In addition, for a man, it can not do without common sense, even though common sense can not directly make money to eat, but it affects conversation, affect your judgment and decisiveness, determines the extent you accept new things and new knowledge. Accordingly, the assembly language is a computer language which is common sense and basic.

If you learn C language and master it, to learn a compilation, you will have a new understanding of the C language, which will help you to understand more programming. Everyone says, C ++ quite complex, but some say, the complexity of C ++ are some deceptive appearance, after being compiled C ++, C, and it is almost the same thing. In the C language, pointers talked about that part of the address of this concept, but in the assembly, with regard to the application address everywhere, a simple few lines of assembly code would have to use the address. But sometimes, we can not address a clear distinction between what is and what is data. The reality is this, it can sometimes be address data, and sometimes can also be addresses.

In fact, in C / C ++, each variable name, the name of each function will be C or C ++ compiler to compile address. However, sometimes the address and data are not to be distinguished.

We can not appropriate the various registers inside the CPU (those registers are frequently used CPU) CPU as the "speech toilet paper," Of course, we do calculate calculus of toilet paper, they might graffiti, The CPU will not. CPU and its "speech toilet paper" and "wipe" and "write" speed is quite fast.

Different CPU have different assembly instructions, only need to understand a common, simple structure assembly instructions CPU, and then study other CPU time, it will be relatively smooth.

Consider the experience of a house when the lid steps: sand, cement, steel, wood, aluminum ... -> bricks, tiles, cement board ... -> a wall, a window ... -> a house; think again roughly development process programming languages: machine language -> Assembly language -> high-level programming language (structured programming language) -> high-level programming language (object-oriented programming language) - -> frameworks (such as a web frame --Django frame in Python) or modules can be used directly (such as Python may be comparable and scientific computing MATLAB libraries and --numpy matplotlib). In fact, look backwards development of programming languages, and decompilation feeling is similar.

After the above comparison, to build a house development process and programming languages ​​have many similarities. If you put together all kinds (such as via the Internet together) computing device likened to the living environment of the program (we might call it "computing environment"), the program is designed to build homes in this environment, create creatures, this is precisely reflects the famous saying of object-oriented programming - all things are objects. Then think about computer viruses, it will feel even more apposite metaphor. computer virus is this computing environment harmful "creatures", these programs will only undermine "computing environment", the infection rate is also very fast, very strong destructive power, such as Panda destructive power can be in the real world and Ebola Comparable.

Speaking of which touch on a little farther, then get down to business.
Assembly language like the tall buildings of sand, cement, steel ... in time to build a house, in order to improve efficiency, we start from bricks, or even a wall started. But the brick walls and in the end what constitutes, if strong enough, we need to understand its basic components. Is a programming language should be based on certain CPU, there will be a CPU instruction set. Therefore, it is necessary to learn assembly!

2, everything is coded

2.1 represents the human world with coding

Man is a hieroglyphic, that is to say, man is encoded using graphics. For example, Pinyin, is to piece together one by one syllable, so is the issue of a phonetic encoding sound waves to us humans. Another example, is the latitude and longitude encoding any location on Earth, and another example, encoding human galaxy also graphically. The most typical is the genetic material of organisms (such as DNA), is also a coding. Genetic material will determine a person's sex, height, whether eyelid, intelligence, whether or not likely to be obese and so on. A person's life is actually the process of its implementation of its genetic material encoding (this statement may not be appropriate).

2.2 computing elements

A good system can represent better representation of computing elements, and represents a logical relationship between computing elements, which can better express our logical thinking, then we can speed up the computing speed. For example:
. 1. 3 + 2 =
I + II = III
Obviously, the above two calculation methods, can not see any difference, but when calculating the amount of elements expressed very large when there is a difference.
If human evolution after the get is 16 fingers, rather than the 10 fingers, then it is possible, we are now more common is the hexadecimal instead of decimal (decimal reportedly now popular anthropogenic have 10 fingers ). Accordingly, in elementary school, math teacher will ask students to memorize multiplication tables in hexadecimal (hex multiplication table is also very good preparation, up to "15X15 = 225", 225 into the hex is "E1") rather than the multiplication table. For the same size of two very large numbers on paper, it is clear that more saving paper when the hexadecimal representation.

to be continued. . .

Released five original articles · won praise 2 · Views 135

Guess you like

Origin blog.csdn.net/weixin_42766637/article/details/103948195