Are Instruction set architecture binary (not reada

2019-09-08 09:11发布

  1. If I am correct, an ISA is the set of instructions in a machine language. So are the instructions in an ISA 0/1 binary sequences?
  2. Why did I see the instructions in an ISA are human-readable words in books?

    Are the human-readable words that represent the instructions in an ISA the same as the mnemonics used in the assembly language of the ISA?

    Are the human-readable words of the instructions in an ISA part of the ISA?

    If yes, is there a translation process that translate from the human readable instructions in an ISA to a machine language, just like an assembler translates an assembly language to a machine language?

Thanks.

2条回答
Luminary・发光体
2楼-- · 2019-09-08 09:26

The ISA defines at least the name of the instruction and the binary encoding of the instructions and its operands. It may also define the assembler syntax / semantic to use, that is, the human-readable form.

But, an actual compiler can use a different syntax. For example: for the IA32 ISA (x86), there is a Intel and an AT&T assembler style. Both differ in whether the result register is specified as first or last operand in an assembler instruction.

查看更多
女痞
3楼-- · 2019-09-08 09:26

the human readable words in books are called assembly language and yes a tool called an assembler converts the assembly language into machine code which is just ones and zeros that mean something to the logic. You can also disassemble taking the machine code and ending up with assembly language.

The collection or set of instructions for a particular processor is called the instruction set or instruction set architecture or ISA.

The machine code is what matters, that is what the processor operates on. the human readable assembly language does not necessarily have a standard. The company that designs the processor usually creates a document with both the machine code and an assembly language and usually they create or have someone create an assembler that matches that assembly language. But that does not constitute a standard. anyone can invent any assembly language and assembler they want for that architecture so long as it produces machine code (well if they want it to be useful, the could create random garbage and have it crash if that is their goal).

The intel vs at&t formats are well known for different assembly languages for the same processor family. but the folks that do the gnu assembler ports tend to also mess up the original assembly language. Mostly the directives, the non-instruction portions of the assembly language are the parts that might vary from one assembler to another. Again you could sit down and make your own, and dream up any syntax you want so long as your assembler and/or compiler makes working machine code for that target.

Since you really have to have an assembler to develop and test a new instruction set...you have an assembler...When porting a compiler or language the author of that doesnt have to go crazy reading binary machine code, they can just output assembly language then spawn the assembler. This is an extremely common way to do it, but some compilers go straight to machine code for various reasons. JIT, or "just because I can".

查看更多
登录 后发表回答