CHAPTER ONE - Introduction To System Programming
CHAPTER ONE - Introduction To System Programming
Chapter one:
Introduction to System Programming
After you have studied this unit, you will be able to:
Introduction
A modern software application typically needs to manage both private and system
resources. Private resources are its own data, such as the values of its internal data
structures and system resources are things such as files, screen displays, and network
connections. Threads and sub processes are also system resources. Modern operating
systems prevent application software from managing system resources directly, instead
providing interfaces that these applications can use for managing such resources.
Although it may seem that functions from the C standard library such as fprintf() access
files directly, they do not; they make calls to system routines that do the work on their
behalf.
Definition
One characteristic in which most system software differ from application software is
machine dependency, free users from knowing the detail of machines.
✓ Compilers are system programs that accept human like language and translate
them into machine languages.
✓ Loaders prepare machine languages for execution. Macro processors allow
programs to use abbreviations.
✓ Programming Languages: Machine Language (ML)->Assembly Language (AL)->
HighLevel Programming Language (HL)
• ML: machine code, i.e, binary code, e.g., 01100110
Relations
✓ Type and modify a program in HL or AL (by an editor)
✓ All the processes and programs are run under and controlled by an OS such as
Windows or Linux.
✓ IDE (Integrated Development Environment)
Machine Structure
• Basic Machine
• Mnemonic(Symbol)
Basic Machine
In this development phase the programmer has a basic machine at his disposal
that interprets instruction by hardware. Then a programmer writes series of 0s and 1s
(machine language) place them into memory. Finally, press a button and start executing.
This approach is not suitable as it is difficult to read/write in machine language. Hence,
programmers have to find a better remedy (mnemonic for each instruction).
Mnemonics (Symbol)
Loader: a program that places program into memory and prepares them for execution.
Minimizes usage of core memory, loader is much smaller than assembler. Avoids re-
translation for each execution. Assembler translates the symbols (once) and stores the
output in secondary memory. Many programmers wrote essentially the same program.
This led to development of ready-made programs or packages written by computer
manufacturers or users. As programs got sophisticated users wanted to mix ready-made
programs and with their own. Users can create main program that calls several other
programs (subroutines; body of computer instructions designed to be used by other
routines to accomplish a task). Closed and open (macro) subroutines: transfer control
to subroutine vs insert the subroutine into the main program.
• Physically place the machine instruction and data into memory (loading)
User problems became more categorized into areas such as scientific, business
and statistical problems: specialized languages (high level programming) were
developed. Examples: FORTRAN, COBOL, ALGOL, PL/I. And they are processed by
compilers and interpreters. A compiler is a program that accepts program written by
high level language and produces an object program. Same name like FORTRAN is often
used for both the language and its compiler. An interpreter is a program that appears
to execute a source program like a machine language.
Summary
The major components of a programming system are:
1. Assembler
2. Macro Processor
A macro call is an abbreviation for some code. A macro definition is a sequence of code
that has a name (macro call). A macro processor is a program that substitutes and
specializes macro definitions for macro calls.
3. Loader
A loader is a routine that loads an object program and prepares it for execution.
4. Compilers
A compiler is a program that accepts a source program "in a high-level language" and
produces a corresponding object program.
5. Operating System
An operating system is concerned with the allocation of resources and services, such as
memory, processors, devices and information.