Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Is a program written in multiple languages an assembler?

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

This article uses easy-to-understand examples to introduce the program written in multiple languages is the assembler, the code is very detailed, interested friends can refer to, hope to be helpful to you.

Error, assembler is not a program written in multiple languages. An assembler is a translator that translates a program written in assembly language into an equivalent machine language program. The assembler inputs the source program written in assembly language and outputs the target program expressed in machine language.

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

Although the program written in assembly language is not as simple and intuitive as the advanced programming language, the compiled target program occupies less memory, has high running efficiency, and can directly refer to all kinds of equipment resources of the computer. It is usually used to write the core part of the system program, or to write a lot of running time and high real-time requirements of the program segment.

Background information

Assembly execution instruction is the symbolic representation of machine instruction, its operation code is represented by memory character, and the address code is directly represented by label, variable name, constant and so on. The assembly execution instructions are translated into machine instructions by the assembler, and there is basically an one-to-one correspondence between them. The assembly pseudo instruction, also known as the assembly instruction, is used to provide the assembler with user-defined symbols, the type of data, the length of the data space, as well as the format and storage location of the target program. its function is to instruct the assembler how to assemble. Source code written in assembly language needs to be converted into executable machine code by using the corresponding assembler. This process is called the assembly process.

Many assemblers can recognize labels (label) and symbols (symbols) that represent addresses and constants, so that operands can be represented with characters without having to write dead. Generally speaking, a specific assembly language corresponds to a specific machine language instruction set one by one.

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 in programming like most other programming languages; in practical applications, it is usually used in low-level hardware operations and demanding program optimization. Drivers, embedded operating systems and real-time running programs all need assembly language.

classification

Simple assembler

A simple assembler is also called a "load and execute" assembler. It is widely used because of its simplicity. The characteristic of this assembler is that the assembled machine language program is directly placed in memory for execution. The storage position occupied by the target program is fixed at assembly time and cannot be changed later, so this working mode cannot combine multiple independently assembled subroutines into a complete program. and can only call subroutines in the library where the location does not conflict with the target program.

Module assembler

The module assembler is developed to adapt to the module programming method. In addition to overcoming the shortcomings of the simple assembler, it also provides the ability to design, code and debug different program modules in parallel, and only the relevant modules can be changed when the program is changed. Each assembled program module is called the target module, and a number of target modules are assembled 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 selective programs or packages in order to tailor and compile appropriate software according to the needs of users and the configuration of equipment. This kind of assembly language usually introduces assembly instructions such as "conditional transfer" and "transfer" in order to selectively assemble some program segments or control the processing path of the assembler according to the assembly conditions specified by the user.

Macro assembler

The main feature of the macro assembler is to add the macro processing function to the assembler. It allows users to easily define and use macro instructions and is suitable for situations where program paragraphs appear in many places, have a certain format and can be adjusted and changed by a small number of parameters. The use of 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 needs to be changed, but not each use.

Advanced assembler

An assembler that uses the control statement structure of a high-level programming language. It not only maintains the advantages of strong expression ability and high program running efficiency of assembly language, but also fully absorbs the advantages of simple writing and easy reading of high-level language.

This is because the advanced assembler allows the user to write the control part of the program using the control statements of the high-level programming language (such as conditional statements, loop statements, functions and procedures). It 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 advanced assembler is N. The PL/360 language assembler developed by worth for the IBM360 system is characterized in that the control part of the program is written by the control statements of the high-level language, while the data processing part is written by IBM360 assembly instructions. Since then, assembler similar to ALGOL and assembler FAT similar to FORTRAN have emerged one after another.

About the program written in a mixture of multiple languages is the assembler? so much for sharing. I hope the above content can be helpful to everyone and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report