Machine Code
Learn what machine code is and how a program is executed.
Computing process
Let’s suppose that the OS loads the contents of an executable file into the RAM. This file contains both the instructions and data of the program. Examples of the data are text strings, box-drawing characters, predefined constants, and so on.
Program instructions are called machine code. The processor executes them, one by one. A single instruction is an elementary operation on the data from the CPU registers.
The CPU has logical blocks to execute each type of instruction. The available blocks determine the operations that the CPU can perform. If the processor does not have an appropriate logical block to accomplish a specific instruction, it combines several blocks to do this job. The execution takes more clock cycles, in this case.
When the OS loads the program instructions and its data into the RAM, it allocates the CPU time slots for that. From this moment onwards, the program becomes a computing process, or process. The process refers to the running program, and the resources it uses. Examples of the resources are the memory area and OS objects.
Hex editors and binary code
There are some special programs to read and edit executable files. They are called hex editors. Such editors represent the program’s machine code in a hexadecimal numeral system.
The actual content of the executable file is binary code. This code is a sequence of zeros and ones. The hex editor translates them into hexadecimal for readability. The processor receives the instructions and data in binary code.
Get hands-on with 1400+ tech skills courses.