You are on page 1of 2

This section is about programming logic and languages so let's

start with some basic concepts like: What is a programming language?


So, programming languages are used to write computer programs or
software, we also called that. So programs are composed of sequences
of precise instructions that indicate how to perform a task,
a task like for example calculate average of students scores or
operate a robot to assemble a car, for example.
these are all tasks that we can program with
a programming language. So what is programming exactly?
The definition of programming is that it's the act of writing software
(so computer programs) writing computer programs to
perform particular tasks using a programming language.
So let's start to look a little bit about
on different levels of programming languages.
so we distinguish machine language, assembly language and high
level programming language, so let's look into each one of those
in a little bit more detail. So machine language is the only language
that a machine can read, it's a combination of bits
so we've already seen that bits are zeros and ones
and actually at a hardware level they represent high or low
electric voltages to instruct the hardware what to do.
So the machine language is a combination of zero and one bits
that tell the machine what to do. Eventually all programs that are
being executed by a computer are converted into machine language before
they can be executed. So machine language is obviously not something
that people or humans write or read.
On the next level, a little bit higher, we have
assembly language. Assembly language is a programming language
that consists of a series of processor instructions,
they're also called mnemonics. So these are commands that instruct the processor
what to do. Although it's also not really for humans, humans can
do it, so let's look at this example and see that we can understand what's
going on there. It's a procedure, the procedure starts there
with the processor instruction proc and after that we see a command
which is cmp which stands for compare. So the command there says
compare AX (it's a register) compare to a value that's an register
AX compares it to 97. Then the next structure says JL:
jump less, so if it's less (the comparison of AX with
97 turns out to be less) then we jump to DONE,
we're finished. If not we go on with the next instruction that
compares again the register AX with 122.
Then we do JG that says jump if greater,
so it says if greater: if AX is greater than 122
then we go to DONE. And if not, we continue with the next instruction
that says SUB: substract AX, the value that is in the register AX
with 32. And then we return and we're finished.
So this is assembly language: series of instructions to the processor
that indicates the processor what to put in which register and how to compare
and what to do according to the result from comparing.
Languages that humans use (programmers) are more high-level languages.
They offer a higher abstraction level. We don't think in processor registers
and comparing values as we are at a higher level
and this is easier to learn because we use English like statements.
We see an example here in in the yellow box
of java program that prints some numbers, so let's look a little
bit at it. Later on we will see more examples and explain a little
bit more the statements that you can see here.
Here we have a high-level language and it says: assign number
1 to the variable that is called number.
Then while this number is less than or equal to some maximum
what we want to do is print this number on the screen and add 1
to the number and go on until the number is
greater than the maximum. This is a high-level language, as
you can see it uses English like statements
to represent the computer program. This is what we typically find
in languages such as Java, C++, Visual Basic, Pascal and so
on: these are all high-level languages.
We've seen programming languages: machine language, assembly language,
and high level language. In the next section we will talk a little
bit more on syntax and semantics of these programming languages.

You might also like