gcc匯編匯編語言
Assembly Language is the interface between higher level languages (C++, Java, etc) and machine code (binary). For a compiled language, the compiler transforms higher level code into assembly language code.
匯編語言是高級語言(C ++,Java等)和機器代碼(二進制)之間的接口。 對于編譯的語言,編譯器將高級代碼轉換為匯編語言代碼。
Every family of CPUs define their own Instruction Set Architecture (ISA), a set of basic instructions that the CPU can execute without needing further translation or transformation. The compiler decomposes composite higher level composite instructions into operations available in the ISA.
每個CPU系列都定義了自己的指令集體系結構(ISA),這是CPU可以執行而無需進一步轉換或轉換的一組基本指令。 編譯器將復合高級復合指令分解為ISA中可用的操作。
Some of the more common ISAS in use today include MIPS, ARM, Intel x86, RISC-V.
今天使用的一些較常見的ISAS包括MIPS,ARM,Intel x86,RISC-V。
Assemblers decompose Assembly instructions into their respective binary representations and replace the generic addresses of assembly code with explicit register and memory addresses of your computer.
匯編程序將匯編指令分解為各自的二進制表示形式,并用計算機的顯式寄存器和內存地址替換匯編代碼的通用地址。
Code where execution time and control is crucial can be written directly in assembler. This, however, comes at the cost of prolonging development time, and making development harder. It should also be noted that there has been a large amount of research going into making compilers optimize the code that is generated automatically.
執行時間和控制至關重要的代碼可以直接在匯編器中編寫。 但是,這是以延長開發時間和使開發更加困難為代價的。 還應注意,已經有大量研究使編譯器優化自動生成的代碼。
Assembly language is primarily used in the following situations:
匯編語言主要用于以下情況:
- There is a need to use CPU instructions not available in higher-level languages. 需要使用高級語言中沒有的CPU指令。
- There is no high-level language to program a certain types of processors. 沒有用于對某些類型的處理器進行編程的高級語言。
- Implementing a compiler for a higher level language on a new ISA. 在新的ISA上為高級語言實現編譯器。
翻譯自: https://www.freecodecamp.org/news/what-are-assembly-languages/
gcc匯編匯編語言