computers do not understand anything except one’s and zero’s.But I want to know the details how a source code or an instruction set is converted into 1’s and 0’s.Is the exe file only contains 1’s and 0’s?
computers do not understand anything except one’s and zero’s.But I want to know the
Share
Each type of operation in a microprocessor’s instruction set is specified by an opcode, which is represented as a pattern of 1s and 0s. A compiler or interpreter translates code in a source language to machine code made up of those instructions.
For example, take this code, where a variable,
x, is assigned the value of 50:The compiler might translate that to the following assembly language, where the AX register (for the
xvariable) is set with the value, 50 (in hexidecimal), using the MOV instruction:If the opcode for
MOVwas 0xA0 and the code for the AX register was 0xB then the machine code, in binary, would look like this: