I was wondering if instruction set and assembly language are the same thing?
If not, how do they differ and what are their relations?
Thanks and regards!
Everything is in layered Architecture with "Strict (most of the time) and Well defined interfaces".
Start From Hardware
There are many layers until you reach up to processor.
Layer I mean we start from "physics->devices(electronics)->Analog(Amplifier)->Gates->Digital Circuits-> Micro-Architecture->Architecture(ISA, Processor)
Software part that is called ISA (Instruction Set Architecture)
It has all instructions that a respected processor can support. It means ISA is bound to only one processor (Hardware like x86).
Important thing is why this ISA is required ?
Same as I told earlier it is Strict and Well Defined Interface. Processor can not run any instruction beyond ISA [Strict]
But Any one who want to use this processor can use these commands from ISA to get his work done. [Well Defined Interface]
Now come to Assembly, C, Assembler, Compiler ....
Layered Architecture you know we use it(Layered Arch) in Hardware to implement one processor for you
You can read more about why this Layered architecture. It make easy to deal with a big problem step by step.
Same here what we want? what our goal is ?
We want user can use this processor easily. Here user is programmer.
Now See the difficulty for programmer.
Can a programmer remember all instruction for a processor those are in binary format. And processor may change in next application from Intel to IBM (not version specific now).
Assembler is also a layer what it has - two interfaces. Same with Compiler.
Ex: You write a code in C. Processor can not understand this code. It understand whatever written in binary format and defined by instruction given in ISA. But it is difficult to write(maintain|modify) a program in instruction in ISA.
1) So User write a code in C. This code a C-compiler understand. Because a user is restricted to use only syntax given in C. That means C-compiler giving a standard and well defined interface to user at one end. At the other and it can use directly ISA instruction or Another interface called "Assembler".
2) Now If you are using Assembler then Compiler will translate all C-Code in to Syntax given by Assembler. And the syntax that Assembler provide to Compiler called assembly language. It is also well defined interface and any one can use it to program in Assembly language. And at the other end Assembler converts all its syntax(Mnemonics|Directives, those are not present in ISA) to binary code instructions in ISA.
Here Some example of this translation.
In this file one line is "Machine: Advanced Micro Devices X86-64" that is providing information about processor accordingly we are using ISA and assembler. And C programmer is not aware of this, he is free to code in C. That is the benefit of "Well Defined Interface".
To Compare Just See
hello.c (C program)
hello.asm2bin (Object File Table: direct mapping Mnemonics and Binary Instruction)
hello.asm2bin_exe (Binary File Table: More mapping after linking)
You will see one line in these files "Disassembly of section .." Since what assembler do : It assemble the ISA instruction(Bit pattern) from assembly language, So here we are seeing first ISA instruction and then desassembly to Mnemonics.
All files are at this link [Download and Open]
https://www.dropbox.com/sh/v2moak4ztvs5vb7/AABRTxl7KQlqU2EkkMkKssqYa?dl=0