Programming in C

(Barry) #1

6 Chapter 2 Some Fundamentals


Higher-Level Languages


When computers were first developed, the only way they could be programmed was in
terms of binary numbers that corresponded directly to specific machine instructions and
locations in the computer’s memory.The next technological software advance occurred
in the development of assembly languages, which enabled the programmer to work with
the machine on a slightly higher level. Instead of having to specify sequences of binary
numbers to carry out particular tasks, the assembly language permits the programmer to
use symbolic names to perform various operations and to refer to specific memory loca-
tions. A special program, known as an assembler, translates the assembly language program
from its symbolic format into the specific machine instructions of the computer system.
Because a one-to-one correspondence still exists between each assembly language
statement and a specific machine instruction, assembly languages are regarded as low-
level languages.The programmer must still learn the instruction set of the particular
computer system to write a program in assembly language, and the resulting program is
not portable; that is, the program will not run on a different processor type without being
rewritten.This is because different processor types have different instruction sets, and
because assembly language programs are written in terms of these instruction sets, they
are machine dependent.
Then, along came the so-called higher-level languages, of which the FORTRAN
(FORmula TRANslation) language was one of the first. Programmers developing pro-
grams in FORTRAN no longer had to concern themselves with the architecture of the
particular computer, and operations performed in FORTRAN were of a much more
sophisticated or higher level, far removed from the instruction set of the particular
machine. One FORTRAN instruction or statementresulted in many different machine
instructions being executed, unlike the one-to-one correspondence found between
assembly language statements and machine instructions.
Standardization of the syntax of a higher-level language meant that a program could
be written in the language to be machine independent.That is, a program could run on
any machine that supported the language with few or no changes.
To support a higher-level language, a special computer program must be developed
that translates the statements of the program developed in the higher-level language into
a form that the computer can understand—in other words, into the particular instruc-
tions of the computer. Such a program is known as a compiler.

Operating Systems


Before continuing with compilers, it is worthwhile to understand the role that is played
by a computer program known as an operating system.
An operating system is a program that controls the entire operation of a computer
system. All input and output (that is, I/O) operations that are performed on a computer
system are channeled through the operating system.The operating system must also
manage the computer system’s resources and must handle the execution of programs.
One of the most popular operating systems today is the Unix operating system,
which was developed at Bell Laboratories. Unix is a rather unique operating system in
Free download pdf