CH04 - Software
CH04 - Software
SOFTWARE
CHAPTER 4
High-level
• A high-level language uses human-language style words. These could be
English words that we recognise and use day-to-day. For example, if,
while, output, print, input; as people we understand these, but they are
also high-level language instructions.
• We will be learning to use a high-level language, for example, Python, Java and VB.NET.
Low-level
• There are two main types of low-level language, machine code and
assembly language. A computer executes machine code, this is in binary
(1s and 0s). If you write a program in a high-level language it needs to be
converted into machine code before it can executed.
Choosing a language
Translators
• High-level language programs, and assembly language programs, need to
be converted to machine code to be executed. This is done using a
translator.
Assembler
• If you have a program written in assembly language, then an assembler is
used to convert the instructions into machine code for the processor the
code is being run on.
An interpreter:
• reads one line of the high-level language code
• checks that it is syntactically correct:
• if it is not, it stops and reports an error to the user
• If it is, it executes the statement and moves to the next.
• Interpreters are most useful when writing the program, because it will stop at
an error, allow you to correct it, and then continue executing from the same
position. Interpreters are not as useful for whole-system testing, or when the
program is complete. This is because all of the code needs to be interpreted
every time the program is run, even if there are no errors.
A compiler
• checks all the code, by going through one-line after the other. If there are any syntax
errors, they are all reported to the user and the program is not executed. If there are no
errors, then an executable file is created. An executable file uses intermediate or object
code derived from the high-level language code. The actual program code is not included
so if someone has the executable file, they cannot view or amend the original code. The
executable file can be run without having to re-translate the code.
• Compilers are useful when you have finished the program or need to test a working
element repeatedly. This is because the code does not need to be translated each time,
the executable file is run repeatedly.