The information you are looking for, is how was the first compiler created ? Well it was developed in binary, to translate code into binary
In the beginning, adding 3 and 5 together looks something like this 0101 1010 0000 0011 0000 0101. After the first compiler, we could write ADD 3, 5 and it will be translated into the binary string written above.
Now, the program that translates “ADD 3, 5” into “0101 1010 0000 0011 0000 0101” had to be written with 0s and 1s.
That program would be something like
“If the first character is A and the second is D and the third is D, output 0101 1010”
If a character is 1, output 0000 0001
If a character is 2, output 0000 0010
…
Of course this paragraph could be hundreds of segments of binary code, but it is achievable. And once you are able to write the addition (ADD), the substraction (SUB), division (DIV), multiplication (MUL), … You can then use this code to write a new compiler in code that translates code to binary, instead of using the compiler written in binary
Latest Answers