For computers to process any computer language it needs to be translated into machine code. Machine code
is the lowest level programming language consisting of os and ts. Computer languages can be high level or
low level. Assembly language is a low Ievel language.
,, .,,,,.),
High level languages /
) one instruction of high levell code represents many instructions of machine code
) the same code will work for many different machines and processors
) the programmer can easily store data in lots of different structures without knowing about the memory
+ code is easy to read, understand and modify
) must be translated into machine code before a computer is able to understand it
i don't have much control over what the CPU does so programs will be less memory efficient and slower
) e.g. Python
I
i\-, Low level languages
ll
l"'t o
(6
) one instruction of assembly code usually only represents one instruct ion of machine code J ,lk-c, 1l to
^k, "ndpv!l o^J,
-r usually written for one type of machine or processor and won't work on any others , -r\!.
) the programmer needs to know about the internal structure of the CPU and how it manages the memory
-) code is very difficult to read, understand and modify .l . I .\
) commands in machine code can be executed directly without the need for a translator
) user controls exactly what the CPU does and how it uses memory so programs will be more memory
efficient and faste r ""'rt ' t'rr od)'c'' l'r(rlcp't 'p'r \'a,tk
.r ,.^,r, ,,r ,,A ,,""n l' ' 'a?'S
. l,lyl-..'o.,.,
I
,. t'.' .t,a., ,! ,.';i'..7''''f'
'
/'
'!
',
Translators convert programining languages into machine code. High level languages need to be translated
before a computer is able to execute the instructions.
/ ASSEMBLERS - used to turn assembly language into machine code. There are lots of different assembly
languages and each one needs its own assembler.
Compilers and interpreters are both used to turn high level language into machine code.
Compilers , * e'et' [alo(elile is k'veadol'\e
+).\.r r.o cqsqa\ 1 - ro1-qgle
) translates all ofthe source code at the same;ie and creates one executable file ihto is hoI"q,,q.,d
Pq<(e'r oh
+ t"'"'trrred [otl'e'
) onlyneeded once to create the executabre file ""a" "^t
+.o ,.Ptlevs oFk-\^i re to d" -
r returns a list oferrors for the entire program once compiling is complete r-o'e'etkck'-e !-oy loo.c[^i"c
) once compiled the program runs quickly, but compiling can take a long time , a, ,, a *o.r
-9 :*."*';-otl" -
- .'.'J,ilJ'o,"",o * ,,
Iater?reter: l-o dp"ocqssor srrci[ic
) translates and runs the source code one instruction at a time, but doesn't create an executable file
+ needed every time you want to run the program
, the interpreter will return the first error it finds and then stop - useful for debugging
+ programs will run more slowly because the code is being translated as the code is running
+ e asrev lo clebu5
{ e.ovs pic\ced up li'.e L.1 ttrno
{ ca.Slpv to tt? gyi y1,1e!1k
-.odq vun! Stor-?v
- rod,€ nof oPk"*rsed