But It was not always like this. Programmers could only program in Machine language in the past because that is the only language computers understand.
So what changed? Do computers now understand other languages aside from machine language?
I will provide answers to these questions and more in this article. Keep reading…
Definition of Terms
This is also called machine code or object code. It is made of binary digits (zeroes (0's) and ones(1's)) and is only what computers understand. They send specific instructions to the CPU to act in one way or another.
As you can imagine, it will be a lot of work to write code with it. For example, this article shows that the following code will output "Hello World."
01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100
These are abbreviations that correspond to different machine code instructions. Examples include
FWD, etc. So to move items from one memory location to another can now look like this:
mov DS, 5
The code above tells the computer to move
5 into the
This language is also referred to as assembler language or symbolic machine code. It was coined due to the difficulty in programming with machine code. It provides some level of abstraction by using Mnemonics and is converted to machine code using an Assembler (compiler).
Here is a sample Assembly program to display “Hello World” following this article:
global _main extern _printf section .text _main: push message call _printf add esp, 4 ret message: db 'Hello, World!', 10, 0
A language that falls into this category provides a high-level abstraction so that a programmer can write code in a more human-friendly language (such as English), and manipulate low-level code.
In other words, a programmer can tell the computer what to do and how to do it using the language.
Examples of such programming languages are C, C++, and Rust. These languages are converted to machine code using various compilers and interpreters.
A high-level language allows the programmer to write code in a human-friendly language (such as English) without having to bother about how it will be executed. So developers can just tell the computer what to do and the computer will know how to do it.
And that is how it works!
So do computers now understand other languages aside from machine language? - NO!
What changed? - Computers now have softwares (assembler, compilers, and interpreters) that convert other programming languages to machine code.
Top comments (0)