Reputation: 1851
I have a few confusions
Is assembly implemented only in software with assembler?
Who updates and writes assemblers?
Is the cpu not even aware that assembly exists?
If let's say Intel releases a new cpu with added new instructions, what needs to be done to utilize those new instructions?
I mean In the end the cpu executes only machine code which is then translated to electrical signals through microcode engine.
Upvotes: 2
Views: 194
Reputation: 20025
Is assembly implemented only in software with assembler?
Assembly is a language that is very very close to machine code. So it must be considered software.
Who updates and writes assemblers?
So everyone who has a good knowledge of the instruction set can write an assembler but also he needs to know the object file format. That means he has also to know how the os wants this format. Cpu manufacturers have the needed knowledge but also if adequate documentation is provided, everyone can write assemblers like the open source community.
Is the cpu not even aware that assembly exists?
Cpu isn't aware of how machine code was generated. It just executes machine instructions.
If let's say Intel releases a new cpu with added new instructions, what needs to be done to utilize those new instructions?
If Intel adds new instructions, then the assemblers must be updated by adding new mnemonics for these instructions.
Upvotes: 2
Reputation: 700622
Is assembly implemented only in software with assembler?
Yes. Assembly language is a programming language just like any other, it just uses operation codes that are very close to the instruction set in the processor. It still compiles from a text file that contains source code into machine code that the processor can use.
Who updates and writes assemblers?
Anyone who likes to, from large software companies like MASM from Microsoft, to open source projects like The netwide assembler (NASM).
The companies creating the processors specify the instruction sets, and anyone can write an assembler that compiles to that set.
Is the cpu not even aware that assembly exists?
Exactly. The processor only executes machine code, it can't know if it was created by compiling assembly source code or Visual Basic source code.
If let's say Intel releases a new cpu with added new instructions, what needs to be done to utilize those new instructions?
You can use them directly in the assembler by just putting the byte codes for the instructions in the code. If you want to use assembly operation codes to use them, those needs to be added in the assembler.
Upvotes: 5
Reputation: 7061
Assembly language is nothing but a form of encoding the machine instructions, the same as the hex or decimal numbers, with addition of some directives for describing data fields placed in the memory. (notice, that in the Von Neumann architecture, the data and the executable code does not differs)
Of course, the encoding provided by assembler is much more convenient for a human reading, writing and understanding. It is invented especially with this goal in mind.
The assemblers are written by humans. For example, FASM has been written and is supported by Tomasz Grysztar, a brilliant programmer and mathematician from Poland.
NASM is another good assembler. It has been written by a team of programmers.
Upvotes: 4