The composition of assembly language: 1. Transfer instructions, including general data transfer instructions, conditional transfer instructions, etc.; 2. Logical operations, this part of the instructions is used to perform arithmetic and logical operations; 3. Shift instructions, used To move the register or memory operand a specified number of times; 4. Bit operations, including test instructions BT, bit test and set instructions BTS, etc.; 5. Control transfer, including unconditional transfer instructions JMP, conditional transfer instructions "JCC/JCXZ" Etc.; 6. String operation, used to operate on data strings; 7. Input and output, used to exchange data with peripheral devices.
The operating environment of this tutorial: Windows 10 system, DELL G3 computer.
Because the assembly instruction system is huge, it is necessary to build an instruction system system with a large number of instructions, complex formats, and poor memorability. The most difficult thing about the instruction is the addressing mode supported by the instruction. Its essence is how to obtain the operands in the instruction. For the processor, it's how to find the data it needs. However, for the underlying assembly language of the computer, this addressing method will involve a large number of calculation storage formats and is closely related to complex storage management methods, making it difficult to understand. Finally, assembly instructions are also related to how to affect flag bits, but processor flag bits are very complex, so it is difficult to master their mechanisms.
Transfer instructions
Logical operations
Shift instructions
Bit operations
Control transfer
String operations
Input and output
Assembly language is more readable than machine language, but compared with high-level languages, its readability is still poor. However, programs written using it have the characteristics of small storage space usage and fast execution speed, which cannot be replaced by high-level languages. In actual applications, whether to use assembly language depends on specific application requirements, development time and quality.
Advantages
Assembly language is a second-generation programming language above machine language. It also has many advantages:
It can easily read memory Status and hardware I/O interface statusThe code written can be executed accurately because it has fewer compilation linksAs a low-level language, it has high scalabilityshortcoming
Because the code is very monotonous and there are few special instruction characters, it makes the code lengthy and difficult to write.
Because the assembly still needs to call the memory to store the data, it is easy for BUG to occur, and it is difficult to debug. Not easy
Even if a program is completed, it will take a lot of time to maintain it later.
Because of the particularity of the machine, the defect of poor code compatibility is caused.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What are the components of assembly language?. For more information, please follow other related articles on the PHP Chinese website!