Unit1 SP Notes 2021

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

UNIT-1 SYSTEM PROGRAMMING /4 CSE/PJLCE

UNIT 1:Introduction to System Programming

What is System?
System is the collection of various components • Ex:- Computer is a system
Computer is a system because it consist of various components like memory,central processing
unit,keyboard,mouse,etc

What is Programming?
Art of designing and implementing the programs.Program has its input and output.By providing input,it
gives output.

What is Software ?
Software is collection of many programs .
• Two types of software – 1.System software 2.Application software

System S/w
Software
Application S/w

1. System software: These are programs which are required for the effective execution of general user
programs on computer system. OR

System software coordinates the activities and functions of hardware and software, and it controls the
operations of computer hardware.

Ex:- Operating System , Assembler ,Compiler,Interpreter,Loader,Linker,Macro and Macro


Processor,Formal System ,Text Editor, Debugger , Device Drivers,Utility Programs,etc.

2. Application software : These are the software developed for the specific goal.

Ex. Media Player, Adobe Reader,Word Processing S/w, media player, Data base S/w, Graphics S/w,
Spreadsheet S/w etc.

Q- What is system programming?


Ans:- Design and implementation of system software or program is known as system programming. Or It
is an art of designing and implementing system programs.

Objective of system programming:


 To learn procedures for the design of S/w System
 To provide a bases for judgment on this design of software

Q-Explain the components of system programming.

Evolution of the components of a programming system


1. Assemblers:-It is a program used to translate assembly Language program into machine language
Machine code or Object code
O/P
Assembly Language
1 SEMESTER
Source Program IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE
ASSEMBLER
I/P
input

 Need:- Programmers found it difficult to write program in machine language.


 A assembler could place the object program in memory however, this would waste Core by leaving
this assembler in memory while the user’s program was being executed. Also this programmer have
to translate his program with each execution, thus wastage of Translation time.

2. Loader:-
It is a system program that places program into memory and prepares them for execution.

Loader perform four functions:


 Allocation : Allocation space in memory for the programs
 Linking : Resolve symbolic references between object devices.
 Relocation : Adjust all address-dependent locations such as Address constants to corresponds to the
allocated space.
 Loading : Physically place this machine instruction and data into memory.

3.Macros:It is a single line abbreviation for the group of instructions.


Macro Processor is a program which process macro call and substitute macro definition in place of macro
call.
It treats the identical parts of the program defined by the abbrevation as a macro definition and saves this
definition.
Need:
i. To relive programmers of the need to repeat identical parts of their program. OS provide a macro
processing facility, which permits the programmer to define an abbrevation for a part of this program
and to use the abbrevation as its program.
ii. It substituets the defination for all occurances of this abbrevation in the program.
iii. In specializing OS,s the entire OS is written as a series of macro definition.

4.Compiler:
It is a system program that translate the high level language program(Source) into another machine
language or object program(target) .
---Compiler takes an entire program
--Compiler transforms code written in a high-level programming language into the machine code, at once,
before program runs.
--Compiler displays all errors after compilation

Source Program written in HLL Object Program or Machine Code


Compiler
I/P O/P

Error Messages

4.Interpreter: An Interpreter coverts each high-level program statement, one by one, into the machine
code, during program run.
--Interpreter takes a single line of code.
--the Interpreter displays errors of each line one by one.
Ex. FORTRAN , COBOL, PL/I etc

2 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


• Benefits of writing a program in a high level language
1. Increases productivity:
2. It is very easy to write a program in a high level language.
3. Machine Independence: A program written in a high level language is machine independent.

5.Formal Systems:
It is an uninterpreted calculus.
It consists of Alphabet,Axioms(a set of words),Inference( A finite set of relation)
These are important in the design, implementation and study of programming Language.
They can be used to specify the syntax( form) and the semantics ( Meaning) of programming language.
Ex:- Set theory, Boolean Algebra, post systems, Backus Normal Form etc.

6.Text Editors - Editor is a computer program that allows a user to create and revise a document.
• A text editor is a program in which the primary elements being edited are character strings.
• A text editor is a type of program used for editing plain text files.
• With the help of text editor you can write your program(e.g. C Program or Java Program).
Example : Notepad.

7.Utility software: It helps to manage, maintain and control computer resources.


Examples of utility programs are antivirus software, backup software and disk tools.
--Antivirus software, helps to protect a computer system from viruses and other harmful programs.
--Backup software helps in the creation of a backup of the files on your computer.
--Disk tools include a range of different tools to manage hard disk drives and other storage devices.

8.Device Driver: A device driver is a computer program that controls a particular device that is connected
to your computer.
Typical devices are keyboards, printers, scanners, digital cameras and external storage devices. Each of
these need a driver in order to work properly.
For example: for printer installation on your system you need to have printer driver.

9.Debugger : Debugging tool helps programmer for testing and debugging programs.

• It provides some facilities: Setting breakpoints. , Displaying values of variables.

10.Operating System-An operating system is concerned with the allocation of resources and services,
such as memory, processors, devices, and information. The os correspondingly includes program to
manage these resources, such as a traffic controller, a scheduler, memory management module , I/O
programs and a file system.
Ex: DOS,Unix,Linux etc.

Evolution of Operating System


OS has evolved over this last to 60 years through several distenet phases of generations:
1) Serial Processing:
OS perform its task serially
Advantages : Simple and ease of programming
Disadvantages: Poor utilization of resources and Time consuming
2) Batch Processing:
Semi less kinds If jobs are batched together and execute at a time
Disadvantage:
CPU is idle because of syncronization Gap between the CPU speed an IO devices.
Increase in response time,No .human intervetion during execution
At a time all the system resources dedicated to a single program.
3) Multi programming:

3 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


It allows this os to keep more than one job on its memory at a times.
The control transfer or context switch occurs on I/O event.
Advantage: Increases throughput
Lower response time
Disadvantage: Complex design, Protection Issue

Q- What is an operating system? State different services provided by an operating system.


Ans:- An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The os correspondingly includes program to manage these resources,
such as a traffic controller, a scheduler, memory management module , I/O programs and a file system.

Function/Services of operating System


1. Program Creation
It provides editors,debugger To assist the programming on creating or writing Program.
2. Program Execution
A number off tasks required to execute a program, the task includes instruction and data to be loaded
into memory ,I/O devices and files must be from other resources be prepared.
3. Command interpretation
It translate the user commands to a language that the CPU can understand.
4. Memory Management
It allocation memory for the Various process running on the system.
5. Process management
It is required when several program have to run concurrently .It ensured that no program gets more
than it’s share of CPU time.
6. Resource Management
It collects all the resources in the N/w environment or a system and grant these resources
to required process for their execution
7. Error Detection
It detects different types of errors and take appropriate actions.
8. I/O Operation Management
A running program may require i/o operations.A user program cannot direcltly execute the
I/O operations directly,the OS must provide some instruction to kernel to do so.
9. Accounting
It keeps track of which user uses how much and what kind of resources.
10. Protection
It provides security mechanism to protect unauthorized usage of files in the network environment.
11.The traffic controller coordinates the processors and the processes.

Facilities provided by OS:


1. Assembler
2. Compiler
3. Sub routing libraries
4. Linkage Editors and program loaders
5. Utility Routine
6. Application Package
7. Debugging Facilities.
8. Data management and tele processing
9. Management of system H/W.

Q-Explain operating system from User viewpoint and System viewpoint


OR
Difference between User viewpoint and System viewpoint
Operating System is designed both by taking user view and system view into consideration.
4 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE
User viewpoint

1. The goal of the Operating System is to maximize the work and minimize the effort of the user.

2. Most of the systems are designed to be operated by single user, however in some systems multiple users
can share resources, memory. In these cases Operating System is designed to handle available resources
among multiple users and CPU efficiently.

3. Operating System must be designed by taking both usability and efficient resource utilization into view.

4. In embedded systems (Automated systems) user view is not present.

5. Operating System gives an effect to the user as if the processor is dealing only with the current task, but
in background processor is dealing with several processes.

System View

1. From the system point of view Operating System is a program involved with the hardware.

2. Operating System is allocator, which allocate memory, resources among various processes. It controls
the sharing of resources among programs.

3. It prevents improper usage, error and handles deadlock conditions.

4. It is a program that runs all the time in the system in the form of Kernel.

5. It controls application programs that are not part of Kernel.

Other Concepts:

Subroutine:-It a body of computer instruction designed to be used by other routines to accomplish a


task.
A facility was provided where by the user could write a main program that used
several other programs or subroutines.
Subroutine are of two types:-
i.Open Suroutine ii) Closed subroutine
Open Suroutine:-It is a subroutine whose code is inserted into main program.If this routine is called four
times in main routine,it is placed at four times at the place where
it is called.
For Example : Macro
Close subroutine:-It can be stored outside the main routine and control transfers to the subroutine.
It has two tasks
1. Transfer of control
2.Transfer of data

 It would be efficient of subroutine could be translated into an object form that the loader could
relocate directly behind this use’s program.
 The task of adjusting programs so they may be placed in arbitrary core location is called relocations.
5 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE
Multiprocessing
Means having more than are processor operating on the some memory simultaneously.
These are concerned with manipulation of data stored in memory.
 Impure Procedures
i. Procedures that modify themselves.
ii. It is poor programming practice.
iii. Impure Procedures are not readily usable.
iv. They are not suitable for multiprocessing.

 Pure Procedures:-
i. Do not modify itself
ii. To ensure that the instruction are the same each time a program uses .
iii. It is a good programming practice.They are easily reusable. pure procedures (re-entrant code) .

Q. What is multiprogramming?What is Fragmentation?

Multiprogramming allows multiple program to reside in separate areas of core at the same time. Program
to reside in separate areas of core at the same time.
MFT---Programs were give a fixed portion of core(Multiprogramming with Fixed Tasks (MFT))

MVT-- Programs were give varying size portion of core (Multiprogramming with Variable Tasks
(MVT)).

Fragmentation: Often in such partitioned memory system some portion could not be used since it was
too small to contain a program. The problem of “holes”or unused portions of core is called fragmentation.

For Example: Memory size- 1000kb program size= 800kb unused portion or hole= 200kb

If there are 5 holes of 200kb memory= 5* 200= 1000kb of memory can be made available by relocatble
partition method by combinnging it together.

Fragmentation has been minimized by the technique of relocatable partitions. Relocatable partitioned
core allows the unused portions to be condensed into one continuous part of core.

Q-Explain the term paging.


Paging is a method of memory allocation by which the program is subdivided into equal portions or pages
and core is subdivided into equal portions or blocks .
The pages are loaded into block.
There are two paging techniques: simple and demand.

Simple Paging:In simple paging all the pages of a program must be in core for execution.

Demand Paging:In demand paging a program can be executed without all pages being in core, i.e., pages.

Q-Difference Between

6 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


SR.NO. Compiler Iterpreter
1. Compiler first scans the entire program and Translate the program line-by-line.
then translate it into machine code

2. Convert the entire program to Each time the program is executed,

machine code; when all the syntax every line is checked for syntax error

errors have been removed execution and then converted to equivalent

takes place. machine code.

3. Execution time is less Execution time is more

4. Machine code can be saved and used; Machine code cannot be saved;
source code and compiler no longer needed. interpreter is always required for
translation.
5. Since source code is not required, Source code can be easily modified
tampering with the source code is not and hence no security of programs.
possible
6. Debugging is slower. Debugging is Faster

SR.NO. Process Program

1. A process is an instance of program in Program is a set of instructions written


execution to carry out a particular task
2. Process is a dynamic concept Program is a static concept

3. A process is termed as an ‘active entity’ A program is an executable file


since it is always stored in the main residing on the disk (secondary storage)
memory and disappears if the machine is in a directory
power cycled. Several processes may be
associated with a same program.
4. A process is the actual execution of those A computer program is a passive
instructions. collection of instructions.

7 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


SR.NO. Open subroutine Close subroutine
1. Open subroutine is one whose code inserted Close subroutine can be stored outside the
into the main program main routine and control transfer to the
subroutine

2. If some open subroutine where called four Close subroutine perform transfer of
times. It would appear in four different control and transfer of data
placed in the calling program

SR.NO. Multiprocessing Multiprogramming


1. Multiprocessing refers to processing of Multiprogramming keeps several programs
multiple processes at same time by in main memory at the same time and
execute them concurrently utilizing single
multiple CPUs. CPU.

2. It utilizes multiple CPUs. It utilizes single CPU.

3. It permits parallel processing. Context switching takes place.

4. Less time taken to process the jobs. More Time taken to process the jobs.

5. It facilitates much efficient utilization of Less efficient than multiprocessing.


devices of the computer system.

6. Usually more expensive. Such systems are less expensive.

8 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


SR.NO. Pure Procedure Impure Procedure

1. A pure procedure does not modify itself. Procedures that modify themselves are
called impure procedures.

2. It can be shared by multiple processors Other program finds them difficult to


read and moreover they cannot shared by
multiple processors.

3. Pure procedures are readily reusable. Impute procedures are not readily
reusable.

4. To ensure that the instructions are the Each processor executing an impure
same each time a program is used. procedure modifies its contents.

5. Writing such procedure is a good Writing such procedure is a poor


programming practice . programming practice.

Q-Explain the machine structure of IBM 360/370.


All the conventional modern computers are based upon the concept of stored program computer, the
model that was proposed by John von Neumann.

The CPU consists of an instruction interpreter, a location counter, an instruction register and various
working register and general register.
The primary interface between the Memory and CPU is via the memory address register and the memory
buffer register.

The components of a general machine are as follows:

1. Instruction Interpreter: the instruction interpreter is a group of electrical circuits(hardware), that


performs the intent of instructions fetched from memory.

2. Location Counter(LC):The Location Counter(LC), also called Program Counter (PC) or instruction
counter(IC) is a hardware memory device which denotes the location of the current instruction begins
executed.

3. Instruction register: A copy of the content of the LC is stored in IR.

4. Working register: are the memory devices that serve as “scratch pad” for the instruction interpreter.

5. General register: are used by programmers as storage locations and for special functions. The 360
machine has 16 general-purpose registers consisting of 32 bits each.

6. Memory address registers (MAR): contains the address of the memory location

9 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


that is to read from or stored into.

7. Memory buffer register (MBR): contain a copy of the content of the memory location whose address
is stored in MAR. The primary interface between the memory and the CPU is through memory buffer
register.

8. Memory controller: is a hardware device whose work is to transfer the content of the MBR to the core
memory location whose address is stored in MAR.

9. I/O channels: may be thought of as separate computers which interpret special instructions for
inputting and outputting information from the memory.

Q-What is an Assembly Language?

Ans:-Assembly Language

There are four main advantages to using assembly rather than machine language.
1. It is mnemonic; e.g, we write ST instead of the bit configuration 01010000 for the store instruction
2. Address are symbolic, not absolute
3. Reading is easier
4. Introduction of data to program is easier

A disadvantage of assembly language is that it requires the use of an assembler to translate a source
program into object code.

General Approaches to New Machines

10 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


In order to know a new machine we have a number of questions in mind. These questions can be
categorized as follows.

• Memory: Basic unit, size and addressing scheme.

• Registers Number of registers, and size, functions, interrelation of each register.

• Data: Types of data and their storing scheme.

• Instruction: Classes of instructions, allowable operations and their storing scheme.

• Special Features: Additional features like interrupt and protections.

Machine Instruction Formats

The formats for machine instructions describe how registers and explicit or implied storage addresses
can be used to specify operands to and instruction.

The formats to be examined are:

RR R1,R2 register register 2 byte

RX R1,D2(X2,B2) register index 4 byte

RS R1,R3,D2,(B2) or R1,M3,D2,(B2) register storage 4 byte

SI D1(B1),I2 storage immediate 4 byte

SS D1(L1,B1),D2(L2,B2) storage to storage 6 byte

SS D1(L,B1),D2(B2) storage to storage

Displacements are in decimal unless coded with X`.

Receiving Field in an Operation

In general, the second operand is moved, added, loaded etc., into the first operand. This means that the
transfer of data is from the second operand to the first.

Q-What are the instruction formats of IBM 360/370 machine?explain with an example.
Ans:-The formats for machine instructions describe how registers and explicit or implied storage
addresses can be used to specify operands to and instruction.

There are 5 instruction formats.


1. RR Format

The RR format is an instruction in which both operands are registers coded in RR format.
11 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE
The machine code format for RR instruction is:

Op R1 R2
0 7 8 11 12 15

The corresponding assembler format is:

Op R1,R2

The RR format instruction Add Register has a mnemonic Op code AR in assembler


therefore:

AR 1,11

2. RX Format

Register index format instructions have their first operand in a register and their second in storage. The
latter is addressed by base, displacement, and index.

The machine code format for RX instructions is:

Op R1 X2 B2 D2
0 7 8 11 12 15 16 19 20 31

The assembler format is:

A R1,D2(X2,B2)

The second operand could use base, index, and displacement components to explicitly define a location.

Example:
The instruction:

A 8,4(9,10)

or

A R8,4(R9,R10)

If the base, index, and displacement is specified explicitly, these will be used in the machine code
translation.

If a symbol is used for specifying an address, then the assembler will generate a base and displacement
from the information it has been given in the USING instruction and the index will be zero unless
explicitly specified.

12 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


Example
Assembler Machine Code
A R3,24(R4,R6) 5A34601 8

RS Format

The RS format uses three operands; the second operand is in storage and uses base and displacement
addressing.

The machine code format is:

Op R1 R3 B2 D2
0 7 8 11 12 15 16 19 20 31

The Assembler format is:

Op R1,R3,D2(B2) Note: There will be a R3 or M3


depending on the context of the
Op R1,R3,Symbol instruction.

The LM - Load Multiple instruction is an example of this format. This loads a number of a registers
with the contents of the same number of consecutive fields at a specified location. The first and third
operands are used together to indicate which registers are to be loaded.

Examples:
Assembler Machine Code
LM R3,R7,24,(R10) 9837A018
LM R3,R7,NUM 9837C04E
LM R3,R7,NUM+4 9837C052

SS Format

There are multiple types of SS - storage-storage format instructions; with one format, the two fields have
the same length; with the other, the lengths are different.

the machine code formats are:

Op L1 B1 D1 B2 D2

0 7 8 15 16 19 20 31 32 35 36 47

13 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


The assembler formats are:

Op D1(L,B1),D2(B2)

SI Format

The Storage Immediate format instruction uses a single byte coded within the instruction itself to hold the
data for the second operand.

The machine code format is:

Op I2 B1 D1
0 7 8 11 16 19 20 31
The assembler format is:

Op D1(B1),I2
Op Symbol , I2

Examples:
Assembler Machine code
MVI NUM,27 921BC04E

14 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


Q-What is Pseudo-op?Explain different Pseudo-op instructions.

Ans:-A pseudo-op is an assembly language instruction that instruct assembler to perform particular task.

 START is a pseudo-op that tell the assembler where the beginning of the program is and allows the
user to give a name to the program.
 END is a pseudo-op that tells the assembler that the last card of the program has been reached.
 USING is a pseudo-op that indicates to the assembler which general register to use as a base and
what its contents will be. This is necessary because no special registers are set aside for addressing,
thus the programmer must inform the assembler which register(s) to use and how to use them. Since
addresses are relative, he can indicate to the assembler the address contained in the base register.
The assembler is thus able to produce the machine code with the correct base register and offset.
 Pseudo -ops(e.g, START and USING) do not generate machine code.
 DC and DS :-The Define Constant (DC) and Define Storage (DS) instructions are pseudo-ops that
instruct the assembler to place a 10, a 4, and a 49 in 3 consecutive full words("F") in memory and
leave 10 more for DATA1.
 A number before the F would cause multiple allocation, e.g DATA DS 100F causes the assembler
to set aside a 100 full word area.
 Example:- DATA DC F ’10,4,49’
 Example:- DATA1 DS 10F
 LTORG- The pseudo op LTORG can tell the assembler to place the encountered literals at an
earlier location. Literal is defined as =F'10.
 The arguments =F'10,=F'49,=F'4' are literals which will result in the creation of a data area
containing 10,49,4 and replacement of the literal operand with the address of the data it describes.
 The assembler will construct a "literal table" at the end of the program.
 This will contain all the constants that have been requested through the use of literals.

 EQU -The EQU pseudo-op allows the programmer to define variables.


 The statement BASE EQU 15 assigns this value 15 to the symbol BASE ' BASE will be
everywhere evaluated as Any sort of valid arithmetic expression may appear as the operand of EQU
statement.
 DROP-This pseudo-op makes the base register unavailable.

Q- What is Machine-op? Or MACHINE OPCODE


Ans:-It is an instruction to machine to perform particula task.
 BALR is an instruction to the computer to load a register with the next address and branch to the
address in the second field.
 It is important to see the distinction between the BALR which loads the base register, and the
USING which informs the assembler what is in the base register.Therefore, if the register does not
contain the address that the USING says it should contain, a program error may result.
 BR 14 is the machin-op instruction, is a branch to the location whose address is in general register
14 .By convention calling program leave their return address in register 14.
 The BR 14 instruction has been translated to BCR 15,14.
 This is because BR is a member of the assembler mnemonic group of instruction that allow the
programmer to use a more mnemonic opcode in place of BC followed by a particular mask value.

Q-What is the use of base-index addressing ?OR/


What is the advantage/Disadvantage of base register addressing?
The motivation is twofold. First a base register adis in the process of relocation of a program. An entire
program may be moved from one series of location to another by changing the contents of a base register. A
major motivation for employing base register, however is to promote efficient addressing of core. For
example in order to address all possible core location(16 million) in the 360 without the use of a base
register, we would need 24 bits for every address.we would need a toatl of 40 bits to store it; 8 bits for the
op code, 4 bits to specify one of 16 possible registers to which the number is added, an additional 4 bits to
specify one of 16 possible index registers, and lastly 24 bits to specify the address of the number we wish to
add.

15 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


If we use a base register, we can store the instruction in the following format. We could specify any one of
16 possible registers as the base register, using 4 bits and employ an additional 12 for an offset. The total
number of bit for an add instruction would be 32, a saving of 8 bits per address reference.
The disadvantages of this shorter from are the overhead associated with The formation of the address during

execution and the fact that the offset. Which is 12 bits long, can only specify a number from 0 to 4,095.
Thus it may be difficult to “reach” the data. That is, without using an index register and without changing
the contents of the base register, the core location we wish to address cannot be any further than 4,095
locations away from the core location to which the base register is pointing.

Q-What are different data formats of IBM 360/370?


The 360 may store several different type of data as is depicted in Figure. That is, groups of bits stored in
memory are interpreted by a 360 processor in several ways. If a 360 interprets the contents of two bytes as
an integer, it interprets the first bit as a sign and the remaining 15 as a binary number (e.g., 0000 0010
0001 1101 is interpreted as the binary number equivalent to the decimal number+541). If a 360 interprets
the contents of two bytes as a packed decimal, it would interpret the first byte as two BCD coded digit, the
first four bits of the second byte as a BCD digit, and the last four as a sign(e.g 0000 0010 0001 0010 is
interpreted as the decimal number-021).

16 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE


Data formats for the system/360And 370

Q-What is subroutine? Difference bettween open and closed subroutine.


Ans:- A subroutine is abody of computer instruction designed to be used by other routines to accomplish a
task.
An open subroutine or macro definition is one whose code is inserted into the main program(flow
continues).
Thus if the same open subroutine were called four times, it would appear in four different places in the
calling program.
A closed subroutine can be stored outside the main routine, and control transfers to the subroutine.
Associated with the closed subroutine are two tasks the main program must perform; transfer of control and
transfer of data

17 SEMESTER IV NOTES OF UNIT-I DEPT OF CSE , Dr.VIJAYA P BALPANDE

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy