0% found this document useful (0 votes)
4 views

SYSTEMS PROGRAMMING COM 212_2021

Systems programming involves writing essential programs for computer systems, such as operating systems and compilers, requiring in-depth knowledge of the specific computer architecture. Assembly language, which corresponds directly to CPU instructions, is used for performance-critical tasks but is less common for complete programs. Compilers and interpreters translate high-level languages into machine code, while operating systems manage hardware resources and provide user interfaces.

Uploaded by

salamayomide321
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

SYSTEMS PROGRAMMING COM 212_2021

Systems programming involves writing essential programs for computer systems, such as operating systems and compilers, requiring in-depth knowledge of the specific computer architecture. Assembly language, which corresponds directly to CPU instructions, is used for performance-critical tasks but is less common for complete programs. Compilers and interpreters translate high-level languages into machine code, while operating systems manage hardware resources and provide user interfaces.

Uploaded by

salamayomide321
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

SYSTEMS PROGRAMMING (COM 212)

Systems programming is the act of writing the programs needed for a computer system to
function (as opposed to the programs that do particular kinds of useful computation). Some of
the programs that systems programmers write include operating systems, language processors
and compilers, and data file management programs.

Systems programming requires considerable knowledge of the particular computer system


being used.

ASSEMBLY LANGUAGE AND ASSEMBLERS

Assembly language a computer language in which each statement corresponds to one of the
binary instructions recognized by the CPU.

Assembly-language programs are translated into machine code by an assembler.

Assembly languages are more cumbersome to use than regular (or high-level) programming
languages, but they are much easier to use than pure machine languages, which require that all
instructions be written in binary code.

Complete computer programs are seldom written in assembly language.

Instead, assembly language is used for short procedures that must run as fast as possible or
must do special things to the computer hardware.

For example, below is a short routine that takes a number, checks whether it is in the range 97
to 122 inclusive, and subtracts 32 if so, otherwise leaving the number unchanged. (That
particular subtraction happens to convert all lowercase ASCII codes to their uppercase
equivalents.)

This particular assembly language is for the Intel 8086 family of processors (which includes all
PC-compatible computers); assembly languages for other processors are different. Everything
after the semicolon in each line is a comment, ignored by the computer. Two lines (PROC and
ENDP) are pseudo instructions; they tell the assembler how the program is organized. All the
other lines translate directly into binary codes for the CPU.

Many of the most common operations in computer programming are hard to implement in
assembly language. For example, there are no assembly language statements to open a file,
print a number, or compute a square root. For these functions the programmer must write
complicated routines from scratch, use services provided by the operating system, or call
routines in a previously written library.
Pseudo Code

; Example of IBM PC assembly language

; Accepts a number in register AX;

; subtracts 32 if it is in the range 97-122;

; otherwise leaves it unchanged.

SUB32 PROC ; procedure begins here

CMP AX, 97 ; compare AX to 97

JL DONE ; if less, jump to DONE

CMP AX, 122 ; compare AX to 122

JG DONE ; if greater, jump to DONE

SUB AX, 32 ; subtract 32 from AX

DONE: RET ; return to main program

SUB32 ENDP ; procedure ends here

Assembly coding structure: Opcode Operand (destination), Operand


(Source/destination)

Algorithm to sum 5 and 2

MOV eax, 5

ADD eax, 2

MOV SUM eax

Uses of Assembly language includes but not limited to the followings:

Communication with hardware

Design of operating systems


Embedded programming

Device drivers programming

Direct hardware manipulation

Aviation industry.

COMPILERS AND INTERPRETERS

Compiler - a computer program that translates C, C++, BASIC, Pascal, or a similar high-level
programming language into machine language. The high-level language program fed into the
compiler is called the source program; the generated machine language program is the object
program.

Interpreter - a program that executes a source program by reading it one line at a time and
doing the specified operations immediately. Most Perl and Python systems are interpreters.
Contrast COMPILER.

Assembler - a computer program that translates assembly language into machine language. See
ASSEMBLY LANGUAGE; MACHINE LANGUAGE; COMPILER.

OPERATING SYSTEMS

Operating system a program that controls a computer and makes it possible for users to enter
and run their own programs.

A completely unprogrammed computer is incapable of recognizing keystrokes on its keyboard


or displaying messages on its screen. Most computers are therefore set up so that, when first
turned on, they automatically begin running a small program supplied in read-only memory
(ROM), or occasionally in another form (see BOOT). This program in turn enables the computer
to load its operating system from disk, though some small microcomputers have complete
operating systems in ROM.

Under the control of the operating system, the computer recognizes and obeys commands
typed by the user. In addition, the operating system provides built-in routines that allow the
user’s program to perform input-output operations without specifying the exact hardware
configuration of the computer. A computer running under one operating system cannot run
programs designed to be run under another operating system, even on the same computer. For
articles on specific operating systems, see CMS; CP/M; LINUX; MAC OS; MS-DOS; MVS; OS/2;
OS/360; UNIX; WINDOWS (MICROSOFT); Z/OS.
Functions of operating systems includes but not limited to:

Memory management

Processor management

Storage management

I/O management

Application management

Protection and security of data, users and programs management

Network management

Others

INPUT AND OUTPUT

Input - information that is given to a computer; the act of giving information to a computer.
(Note that the terms input and output are always used from the computer’s point of view.) The
input data may be either numbers or character strings (e.g., a list of names). The computer
receives input through an input device, such as a keyboard, or from a storage device, such as a
disk drive.

Output - the information that a computer generates as a result of its calculations.

Computer output may be either printed on paper, displayed on a monitor screen, or stored on
disk or tape. output device a device that shows, prints, or presents the results of a computer’s
work. Examples of output devices include MONITORs, PRINTERs, and IMAGESETTERs.

UTILITIES AND LIBRARIES

Library

1. A collection of files, computer programs, or subroutines. A loader library is a file containing


subroutines that can be linked into a machine language program. (A collection of standard
programs and subroutines that are stored and available for immediate use)

2. A collection of reference materials and software tools, such as clip art, prerecorded sounds,
and predefined objects.
Utility a program that assists in the operation of a computer but does not do the main work for
which the computer was bought. (A program designed for general support of the processes of a
computer). For instance, programs that compress data or defragment disks are utilities (see
DATACOMPRESSION; FRAGMENTATION; NORTON UTILITIES).

By contrast, word processors, financial programs, engineering programs, and other programs
that do actual work for the user are called application programs.

INTERRRUPTS

Interrupt an instruction that tells a microprocessor to put aside what it is doing and call a
specified routine. The processor resumes its original work when the interrupt service routine
finishes. Interrupts are used for two main purposes:

1. To deal with hardware events such as a key being pressed or a character arriving through a
serial port. These events cannot be ignored; the incoming data must be either processed
immediately or stored in a buffer.

2. To call subroutines that are provided by the hardware or operating system. On the PC, most
DOS and BIOS services are called through interrupts rather than through the ordinary
instruction for calling a subroutine. Windows services, however, are called as ordinary
subroutines.

These correspond to the two main ways of causing an interrupt: by receiving a signal from
outside the microprocessor (a hardware interrupt) or by executing a machine instruction (a
software interrupt).

You might also like