GNVQ Advance IT-
Unit 6 11011101 1011011
01001100 1011100
11011100 1011011
In the very early days of computing these instructions would be given to the computer by setting a series of switches to either on or off which would represent the bit settings. Later, the instructions would have been written in decimal notation, punched onto paper tape or cards and then translated into binary as the card or tape was read into the computer. Even so, this is a very complex and complicated way of writing programs, and means a great deal of time must be spent in training programmers. It then takes a programmer a long time to produce a working program.
The instruction set depends on the internal architecture
of the machine, in other words what processor the machine uses. So
programs written in machine code are not 'portable' to different brands
of computer.
LDA 5000
ADA 6000
STA 5000
These three lines of code add two numbers together and
store the result in the memory location of the first one. The code
does not take into account the size of the numbers as there is nothing
to check whether a carry has taken place. So it is still a complex
process to write a program in assembly language and it is still not a portable
language. However, it is easier to remember that LDA stands for ‘load
accumulator’ than to remember a string of binary digits.
Different high level languages were written to be used in differing situations.
COBOL was used for applications that were intended to process large amounts of data.
FORTRAN was used in scientific programs, where complex calculations were necessary and where it was required to store data to a high level of accuracy.
BASIC was used as a teaching language, although it has some very powerful features.
The C and C++ languages can be used to write systems software.
PASCALwas written to encourage structured programming. An example of PASCAL code is given below:
Read(TaxablePay);
IF TaxablePay < 4000 THEN
tax:=0
ELSE
tax:= TaxRate*TaxablePay;
{end if}
Write(tax:6:2);
High level languages are not deigned for any particular
computer but are what are called ‘portable’. Once you have learned
to program in a high level language you will be able to transfer your skills
to different types of computer.
For low level or assembly languages these translators are called assemblers and they translate each instruction into one machine code instruction.
High level languages are translated by compilers or interpreters and will produce many machine code instructions for each instruction in the original language.
The original code written by the programmer is known as the source code and the translated code that has been produced by the compiler is called the object code. When all the object code modules have been linked together and any library routines included, we then have an executable program.
|
|
|
|