Home > Common Problem > body text

Is an assembly program a program written in a mixture of multiple languages?

青灯夜游
Release: 2020-07-21 15:15:43
Original
9877 people have browsed it

Error, the assembler is not a program written in a mixture of multiple languages. An assembler is a translation program that translates a program written in assembly language into an equivalent machine language program. The input of the assembler is a source program written in assembly language, and the output is a target program expressed in machine language.

Is an assembly program a program written in a mixture of multiple languages?

Assembly language is a machine-oriented language designed for a specific computer or computer series. It consists of assembly execution instructions and assembly pseudo-instructions.

Although writing programs in assembly language is not as simple and intuitive as high-level programming languages, the assembled target program occupies less memory, has higher operating efficiency, and can directly reference various device resources of the computer. It is usually used to write programs for the core part of the system, or to write program segments that require a lot of running time and require high real-time performance.

Background information

Assembly execution instructions are symbolic representations of machine instructions. The operation codes are represented by mnemonics, and the address codes are directly represented by labels, variable names, constants, etc. express. The assembly execution instructions are translated into machine instructions by the assembler, and the two basically maintain a one-to-one correspondence. Assembly pseudo-instructions, also known as assembly instructions, are used to provide the assembler with user-defined symbols, data types, length of data space, as well as prompt information such as the format and storage location of the target program. Its function is to instruct the assembler how to To assemble. Source codes written in assembly language need to be converted into executable machine code by using the corresponding assembler. This process is called the assembly process.

Many assemblers can recognize labels and symbols that represent addresses and constants, so that characters can be used to represent operands without having to hard-code them. Generally speaking, there is a one-to-one correspondence between a specific assembly language and a specific machine language instruction set.

Many assemblers provide additional support mechanisms for program development, assembly control, and auxiliary debugging. Some assembly language programming tools often provide macros, which are also called macro assemblers.

Assembly language is not widely used for programming like most other programming languages; in practical applications, it is usually used in low-level hardware operations and demanding program optimization. Assembly language is required for drivers, embedded operating systems, and real-time running programs.

Classification

  • ##Simple assembler

    Simple assembler Also known as "load and execute" assembler. It is widely used due to its simplicity. The characteristic of this kind of assembler is that the assembled machine language program is placed directly in the memory ready for execution. The storage location occupied by the target program is fixed during assembly and cannot be changed later. Therefore, this working method cannot merge multiple independently assembled subprograms into a complete program, and can only call the location that does not conflict with the target program. subroutine in the program library.

  • Module assembler

    Module assembler is developed to adapt to the module programming method. In addition to overcoming the shortcomings of simple assembly programs, it also provides the ability to design, code and debug different program modules in parallel, and only change the relevant modules when changing the program. Each assembled program module is called an object module, and multiple object modules are combined into a complete executable program by connecting the assembly program.

  • Conditional assembler

    The main feature of conditional assembler is the ability to select and assemble certain program segments. It is suitable for writing programs or program packages that are more selective, so that appropriate software can be tailored and compiled according to the needs of users and the configuration of the device. This kind of assembly language usually introduces assembly instructions such as "conditional transfer" and "transfer" to selectively assemble certain program segments or control the processing path of the assembly program according to the assembly conditions specified by the user.

  • Macro assembler

    Macro assembler The main feature is to add macro processing function in the assembler. It allows users to easily define and use macro instructions, and is suitable for program paragraphs that appear in multiple places in the program, have a certain format, and can be changed by adjusting a few parameters. Using this method not only reduces the length of the program and increases readability, but also when the format of the program paragraph needs to be changed, only the definition part needs to be changed instead of changing every use point.

  • High-level assembler

    High-level assembler An assembler that uses the control statement structure of a high-level programming language. It not only maintains the advantages of assembly language's strong expression ability and high program operation efficiency, but also fully absorbs the advantages of simple and easy-to-read high-level languages.

    This is because the high-level assembly program allows users to use control statements of high-level programming languages ​​(such as conditional statements, loop statements, functions and procedures) to write the control part of the program, and also allows users to directly use assembly language to directly Control storage allocation, access register hardware, and describe algorithms that are difficult to express in high-level languages.

    The first high-level assembler is the PL/360 language assembler developed by N. Worth for the IBM360 system. Its characteristic is that the control part of the program is written using high-level language control statements, while the data processing part is written using IBM360 assembly instructions. . Since then, assemblers similar to ALGOL and FAT, similar to FORTRAN, have appeared one after another.

For more related knowledge, please visit: PHP Chinese website!

The above is the detailed content of Is an assembly program a program written in a mixture of multiple languages?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template