ISA(例如MIPS)和汇编语言之间的区别

Geo*_*ton 7 assembly mips isa

ISA(例如,MIPS)和汇编语言之间有什么区别?我看到了一些似乎同义词使用的情境.

Jul*_*ian 9

指令集架构(ISA)在物理上对应于特定处理器内的机器操作.这意味着ISA列出了可由特定处理器执行的任何和所有指令以及操作码.

汇编语言通常与ISA具有1-1关系,但可以以不同方式实现.有时,汇编代码可以执行整套ISA级别指令.

汇编语言是一组抽象的ISA操作码,逻辑和指令,允许变量/宏/函数/方法/等.它们可以是非常基本的(意味着几乎1-1映射),或者它们可以支持更复杂的操作,如结构编程块.


Dol*_*000 5

我怀疑这些术语有任何"权威"定义,但这里有一些感觉,它们可能不完全重叠:

  • 虽然"ISA"标准化了一个处理器的公共接口,该处理器应该用作编写与实现ISA的多个处理器二进制兼容的程序的基础,但"汇编语言"也可以指代由特定处理器,不一定与其他实现兼容.
  • 更一般地,"ISA"是标准文档,而"汇编语言"是编程语言.
  • ISA通常不仅指定指令及其名称,还指定它们的二进制编码(例如操作码和参数编码).术语"汇编语言"仅指示指令的文本形式,而不参考它们的编码.

也就是说,它们显然有很多重叠,因此在非规范性文本中,如果它们在某些情况下可以互换使用,那将是完全可以理解的.


old*_*mer 5

ISA 是指指令集架构。正如这些话所暗示的那样,这是某些特定处理器设计的基于指令的体系结构。某个地方的某个人知道该架构的作用以及使其执行其功能的指令(机器代码)。

Assembly Language is a term for a programming language. Unlike Java or Python, there is not one standard body that makes a definition for one assembly language. Ideally for each ISA there is an Assembly Language, but it is not all that uncommon that more than one or subtle variations can exist between Assembly Languages for a specific ISA. The Assembly Language is essentially defined by the Assembler, sometimes the word Assembler is also used to mean the language itself, I try to separate Assembly Language, the programming language and Assembler the programmers utility that takes the Assembly Language and parses it and converts it to machine code.

Assembly Language is ideally a programming language where you have a one to one relationship between each Assembly Language mnemonic and an instruction in the instruction set (ISA). But this is not always the case, there are things to make your life easier like labels for branching to. There are often a number of directives where you can for example insert some data (a string you want to print perhaps). And there are macros which are not unlike macros in C a way you can write some code you want to reuse one time in one place then simply use the macro.

MIPS is a company that makes processors and the name of the ISA and the name of the Assembly Language and the processors will all bear the name MIPS. Just like Intel processors, Assembly Language and instruction set can be properly called Intel (although we also see x86 and other variations). ARM, same deal, processor, architecture, instruction set, assembly language.

Usually the inventor of an instruction set (as in the group of people working together not necessarily one individual chip engineer), creates documentation for that instruction set, usually including the machine code. Along with that there is usual an assembly language syntax. Often the syntax in the reference manual is the starting point for the Assembler. Not as often there are instructions which are defined here which are actually pseudo instructions, nop is common, some instruction sets dont want to waste an opcode and instead the assembler encodes add r0+0 or and r0,r0 or some such thing that basically does nothing but is a real alu instruction. MIPS has some commonly used assembly language instructions/mnemonics which are pseudo instructions that the assembler generates for you, you have to remember not to use these in the branch shadow (defer slot, whatever term you like to use), or you will or should be warned.