28. How does a machine language differ from an assembly language? Is the conversion one-to-one (one assembly instruction equals one machine instruction)?
Machine language is series of bit patterns (that is the binary form) that are directly executed by a computer, whereas Assembly language is a low-level language that needs compiler and interpreter, which converts that language to machine language. And then it could be understood by a computer.
Machine language is platform-dependent whereas Assembly is platform-independent. Platforms here referred to an operating system like Windows, Linux, etc.
Machine language is not human readable; however, you can interpret it by numbers by hand. Every instruction known as an “op-code” is a number that might be followed in memory by “operands”
Assembly language is a set of instructions which can be read by human and can be understood as well. Here instead to remember the op-codes, “mnemonics” are used. It is however less readable than high-level language.
Machine language can be extremely time-consuming, tedious, and error-prone. However, that’s not the case with Assembly language as mnemonic names and symbols are available here. It is much less tedious and error-prone than the binary machine code.
The problem with both these languages is Program written for one CPU architecture will not work for another CPU architecture. Every new CPU architecture will have a new set of instructions and hence to run the same program for other CPU, one will have to write a program from scratch if its machine language. If its assembly language, accessing memory instruction will change, hence significant modifications will be a requirement.
Is the conversion one-to-one (one assembly instruction equals one machine instruction)?
The answer is obviously Yes. As,
1-1: One assembly language instruction corresponds to one machine language instruction.