In the last article of this series, Sandy explained, how at the processor level, everything is orchestrated to make the machine perform actions. The particular actions among the many that can be performed by the processor is determined by the code.
The machine code is the lowest level of abstraction in software terms. It is the bridge between the software and the hardware.
The machine code are patterns of bits that carries the information on what the processor should be doing. Every processor model will have its own set of machine code. (And that is the reason why programs written in machine level are very hard to port from one model of processor to another).
The machine code, as mentioned earlier are patterns of bits. A set of machine code is called a program and it performs a higher level task. The programs in machine codes are represented as ‘0’s and ‘1’s; they are more conveniently written down as hexadecimal codes (or hex codes).
Another level of abstraction is the ‘Assembly Language’. These are mnemonics that refer to the machine code on a one to one basis. What that means is that every pattern of code would have a assembly language word (English) to represent it.
The codes usually contain to parts - the operator and the operand. Some of the codes have no operands and the word itself holds the information of the task to be performed. An example of a two operand code in the 8086 series of processors is the MOV operation.
MOV A B
That simple code instructs the processor to move the data held in one register to another. (Register is on-processor word-sized memory).
There are other codes that would instruct the processor to add, subtract, multiply, or perform logic operations like AND, OR, XOR on data held in two or more registers and store it in another register. There would be even jumps and other flow control codes that would allow a small program to perform relatively complex tasks.
The actual set of codes, would differ from one processor model to another. It also depends on the type of processor architecture like MISC, RISC or CISC.
The machine level programs allow the interface between the processor and the higher levels. It frees the software designers (to some extent) from the intricate micro-operations that are required to be performed by the processors and focus on the higher level tasks.
In the next post, we will look at the proverbial end of the journey into the realm of software. This may be the end of journey for the hardware, but opens up a large realm where the design of software seems to break through paradigms every now and then.