OS - Study Guide - New
OS - Study Guide - New
For
Operating System Principles and
Design
Prepared by
This study guide will direct the readers to address two parts: Operating system and
computer organization and Assembly programming language. The operating system will enable
to understand an overview of basic operating system, process management, memory
management, I/O management and file management file system. The computer organization will
guide the readers to understand about basic computer design, parallel processing, pipelining and
computer set instructions. The assembly programming language part will enable the readers to
address some of the basic directives, control statements, arithmetic instruction, addressing modes
and string manipulation instruction.
175
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Part I
176
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Unit One
Introduction
Summary
Operating system is the system software which is used as the resource manager, where
the resources are CPU, memory and I/O devices. There is no clear definition of operating
system; however, the basic definition of operating system is based on the function the operating
system. The common evolutions of the operating system are serial processing, batch processing,
multi-programming, parallel processing and real time operating. Operating has four major
functions: process management, memory management, I/O management and file management.
The basic concepts of operating system include process, memory management, files, directory,
system call, interrupts and deadlock.
General Objective
To understand the basic concepts; the design and working principles of operating system
Specific Objective
At the end of this unit the readers are expected to:
4. List some differences between personal computer operating systems and mainframe
operating systems.
178
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Self-test question list with answer key
1. List the function of operating system.
2.
a) Batch. Jobs with similar needs are batched together and run through the computer as a
group by an operator or automatic job sequencer. Performance is increased by attempting
to keep CPU and I/O devices busy at all times through buffering, off-line operation,
spooling, and multiprogramming. Batch is good for executing large jobs that need little
interaction; it can be submitted and picked up later.
b) Interactive. This system is composed of many short transactions where the results of the
next transaction may be unpredictable. Response time needs to be short (seconds) since
the user submits and waits for the result.
c) Time sharing. This systems uses CPU scheduling and multiprogramming to provide
economical interactive use of a system. The CPU switches rapidly from one user to
another. Instead of having a job defined by spooled card images, each program reads its
next control card from the terminal, and output is normally printed immediately to the
screen.
179
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
d) Real time. Often used in a dedicated application, this system reads information from
sensors and must respond within a fixed amount of time to ensure correct performance.
e) Network. Provides operating system features across a network such as file sharing.
f) SMP. Used in systems where there is multiple CPU’s each running the same copy of the
operating system. Communication takes place across the system bus.
g) Distributed. This system distributes computation among several physical processors.
The processors do not share memory or a clock. Instead, each processor has its own local
memory. They communicate with each other through various communication lines, such
as a high-speed bus or local area network.
h) Clustered. A clustered system combines multiple computers into a single system to
perform computational task distributed across the cluster.
i) Handheld. A small computer system that performs simple tasks such as calendars, email,
and web browsing. Handheld systems differ from traditional desktop systems with
smaller memory and display screens and slower processors.
3.
a. Stealing or copying one’s programs or data; using system resources (CPU, memory,
disk space, peripherals) without proper accounting.
b. Probably not, since any protection scheme devised by humans can inevitably be broken
by a human, and the more complex the scheme, the more difficult it is to feel confident
of its correct implementation.
180
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Unit Two
Process Management
Summary
Operating system executes a program in terms of process and thread. A process is the part
of the program which is currently under execution. But, the thread is the light weight of the
process. There are a number of operation performed on the process and during all the operation
the data structure called process control block or process table will be prepared by operating
system for all processes created during program execution. The content of process control block
are pointer to parent process, pointer to child process, program counter register, process id,
process states, memory limit and files opened related to that process. During program execution
the operating system will perform the operation in process level and thread level and there are a
number of algorithms that handles the inter-process communication to maintain the mutual
exclusion and process scheduling.
General Objective
To understand program execution in computer system in terms of process and thread
Specific Objectives
At the end of this unit the readers are expected to:
181
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Identifying the content of process control block.
Understand how the inter- process communication is made during program execution
182
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Identify the ways in which mutual exclusion will be maintained.
2. What is the difference between the role of dispatcher and short term scheduler?
3. Explain why the size of the process is greater than the size of the program from which the
process is originated.
4. Explain the round robin scheduling algorithms with respect to small and large quantum time.
8. What advantage s there in having different time quantum sizes on different levels of
multilevel queuing system?
183
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
9. Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the
I/O-bound tasks issue an I/O operation once for every millisecond of CPU computing and that
each I/O operation takes 10 milliseconds to complete. Also assume that the context switching
overhead is 0.1millisecond and that all processes are long-running tasks. What is the CPU
utilization for a round-robin scheduler when:
c. Round robin
d. Priority
4. Consider a variant of the RR scheduling algorithm where the entries in the ready queue
are pointers to the PCBs.
a) What would be the effect of putting two pointers to the same process in the ready
queue?
b) What would be the major advantages and disadvantages of this scheme?
c) How would you modify the basic RR algorithm to achieve the same effect
without the duplicate pointers?
184
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
5. Can a multithreaded solution using multiple user-level threads achieve better
performance on a multiprocessor system than on a single-processor system?
6. Consider a system implementing multilevel queue scheduling. What strategy can a
computer user employ to maximize the amount of CPU time allocated to the user’s
process?
7. Consider a preemptive priority scheduling algorithm based on dynamically changing
priorities. Larger priority numbers imply higher priority. When a process is waiting for
the CPU (in the ready queue, but not running), its priority changes at a rate α; when it is
running, its priority changes at a rate β. All processes are given a priority of 0 when they
enter the ready queue. The parameters α and β can be set to give many different
scheduling algorithms.
a. What is the algorithm that results from β > α > 0?
8. Explain the differences in the degree to which the following scheduling algorithms
discriminate in favor of short processes:
a. FCFS
b. RR
Answer Key
185
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
2. • CPU utilization and response time: CPU utilization is increased if the overheads
associated with context switching are minimized. The context switching overheads
could be lowered by performing context switches infrequently. This could however
result in increasing the response time for processes.
• Average turnaround time and maximum waiting time: Average turnaround time is
minimized by executing the shortest tasks first. Such a scheduling policy could
however starve long-running tasks and thereby increase their waiting time.
• I/O device utilization and CPU utilization: CPU utilization is maximized by running
long-running CPU-bound tasks without performing context switches. I/O device
utilization is maximized by scheduling I/O-bound jobs as soon as they become ready
to run, thereby incurring the overheads of context switches.
3. Shortest job first and priority-based scheduling algorithms could result in starvation.
4.
a) In effect, that process will have increased its priority since by getting time more often it is
receiving preferential treatment.
b) The advantage is that more important jobs could be given more time, in other words,
higher priority in treatment. The consequence, of course, is that shorter jobs will suffer.
c) Allot a longer amount of time to processes deserving higher priority. In other words, have
two or more quantum possible in the Round-Robin scheme.
5. A multithreaded system comprising of multiple user-level threads cannot make use of the
different processors in a multiprocessor system simultaneously. The operating system
sees only a single process and will not schedule the different threads of the process on
separate processors. Consequently, there is no performance benefit associated with
executing multiple user-level threads on a multiprocessor system.
6. The program could maximize the CPU time allocated to it by not fully utilizing its time
quantum. It could use a large fraction of its assigned quantum, but relinquish the CPU
before the end of the quantum, thereby increasing the priority associated with the process.
7. a. FCFS b. LIFO
8. a. FCFS—discriminates against short jobs since any short jobs arriving after long jobs
will have a longer waiting time.
186
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
b. RR—treats all jobs equally (giving them equal bursts of CPU time) so short jobs will
be able to leave the system faster since they will finish first.
9. The Process scheduling criteria are Utilization, throughput, turnaround time, waiting time,
response time and relative delay.
Unit Three
Memory Management
Summary
The idea behind memory management is very helpful to the readers and programmers so
that they will write a program in a way that there will be efficient memory utilization. For there
has to be an efficient memory utilization one has to understand about multiprogramming concept
in which a number of processes can be executed. There are two classes of memory allocation
methods: contiguous and non-contiguous. Beside these, the virtual memory technique is used to
enhance the memory utilization efficiency along with swapping. However, the memory
management concepts like demand paging and page fault are the concepts that will be raised
with respect to virtual memory. If page fault occurred, then the lost pages will be replaced
187
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
through the efficient page replacement algorithms. Page will be swapped in from hard disk
whenever the page is required in the main memory.
General Objective
Specific Objective
188
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Understand the concepts behind compaction or defragmentation
Explain defragmentation
Explain the
Paging
Segmentation
189
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Explain Belady’s Anomaly with respect to page replacement algorithms.
a) Linking e) Paging
b) Swapping f) Fragmentation
6. Compare the main memory organization schemes of contiguous memory allocation, pure
segmentation, and pure paging with respect to the following issues:
a) external fragmentation
b) internal fragmentation
c) ability to share code across processes
6. Given memory partitions of 100KB, 500KB, 200KB, 300KB and 600KB (in order).
How would each of the FIRST FIT Algorithm, BEST FIT Algorithm and the WORST
FIT Algorithm place processes of 212KB, 417KB, 112KB and 426KB (in order)?
Answer Key
2. If the required page is not available in main memory, we call it page fault.
6.
191
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
a) FIRST-FIT Algorithm
Internal fragmentation = (500-212) + (200-112) + (600-417)
= 288KB + 88KB + 183KB
= 559 KB
External fragmentation = 300KB + 100KB
= 400KB
BEST -FIT Algorithm
Internal fragmentation = (500- 417) + (200-112) + (300-212) + (600-426)
= 83KB + 88KB +88KB +174KB
= 433KB
External fragmentation = 100KB
WORST-FIT Algorithm
Internal fragmentation = (500- 417) + (300-112) + (600-212)
= 83KB + 188KB + 388KB
= 659 KB
External fragmentation = 100KB + 200KB
192
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
= 300KB
b) BEST -FIT Algorithm
c) BEST -FIT Algorithm
Unit Four
Summary
The input – output management is achieved through the I/O subroutine in the operating
system. The I/O devices are directly controlled by the respective device’s controller. However,
there must be the mediator software/ routine that enable the operating system to management the
I/O devices. There are three techniques of I/O devices communication modes: Programmed I/O
mode, Interrupt-driven mode and DMA. The speed of I/O devices is not compatible to the speed
of the CPU and this will be solved by using buffering. The buffering will be attained through
different types of buffers like single buffer, double buffer and circular buffer. The disk accessing
is made using different disk scheduling algorithms.
General Objective
193
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
To understand how the operating system manages the input – output devices.
Specific Objective
Identify which disk scheduling algorithms are the most used in today’s operating
system.
RAID
194
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Self-test question list without answer key
1. Explain the modes of I/O operation.
2. What is the use of interrupt?
3. Explain the DMA operation.
4. In what parameters do you think that I/O devices will differ?
5. Write the two events in which the DMAC sends the interrupt signal to the CPU.
6. List the three types of buffering.
7. Write the difference between sector sparing and sector slipping.
8. Explain the difference between low-level formatting and high- level formatting.
9. What does mean by bad sectors and how do you think it will be handled?
10. List the disk scheduling algorithms and explain them using example.
11. What is the difference between SCAN and C-SCAN disk scheduling algorithm?
1. How does DMA increase system concurrency? How does it complicate hardware design?
2. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently
serving a request at cylinder 143, and the previous request was at cylinder 125. The
queue of pending requests, in FIFO order, is
86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
Starting from the current head position, what is the total distance (in cylinders) that the
disk arm moves to satisfy all the pending requests, for each of the following disk-
scheduling algorithms?
195
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
4. Explain why SSTF scheduling tends to favor the middle cylinders of a disk over the
innermost and outermost cylinders.
5. None of the disk-scheduling disciplines, except FCFS, is truly fair (starvation may
occur).
A. Explain why this assertion is true.
B. Describe a way to modify algorithms such as SCAN to ensure fairness.
C. Explain why fairness is an important goal in a time-sharing system.
D. Give three or more examples of circumstances in which it is important that the
operating system be unfair in serving I/O requests.
Answer Key
1. DMA increases system concurrency by allowing the CPU to perform tasks while the
DMA system transfers data via the system and memory busses. Hardware design is
complicated because the DMA controller must be integrated into the system, and the
system must allow the DMA controller to be a bus master. Cycle stealing may also be
necessary to allow the CPU and DMA controller to share use of the memory bus.
2.
a) The FCFS schedule is 143, 86, 1470, 913, 1774, 948, 1509, 1022, 1750,
130.
The total seek distance is 7081.
b) The SSTF schedule is 143, 130, 86, 913, 948, 1022, 1470, 1509, 1750,
1774.
The total seek distance is 1745.
c) The SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774,
4999, 130, 86.
The total seek distance is 9769.
d) The LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774,
130, 86.
The total seek distance is 3319.
196
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
e) The C-SCAN schedule is 143, 913, 948, 1022, 1470, 1509, 1750, 1774,
4999, 86, 130.
The total seek distance is 9813.
f) The C-LOOK schedule is 143, 913, 948, 1022, 1470, 1509, 1750,
1774, 86, 130.
The total seek distance is 3363.
3. There is no simple analytical argument to answer the first part of this question. It would
make a good small simulation experiment for the students. The answer can be found in
Figure 2 of Worthington et al. [1994]. (Worthington et al. studied the LOOK algorithm,
but similar results obtain for SCAN. Figure 2 in Worthington et al. shows that C-LOOK
has an average response time just a few percent higher than LOOK but that C-LOOK has
a significantly lower variance in response time for medium and heavy workloads. The
intuitive reason for the difference in variance is that LOOK (and SCAN) tends to favor
requests near the middle cylinders, whereas the C-versions do not have this imbalance.
The intuitive reason for the slower response time of C-LOOK is a circular seek from one
end of the disk to the farthest request at the other end. This seek satisfies no requests. It
only causes a small performance degradation because the square-root dependency of seek
time on distance implies that a long seek isn’t terribly expensive by comparison with
moderate length seeks. For the second part of the question, we observe that these
algorithms do not schedule to improve rotational latency; therefore, as seek times
decrease relative to rotational latency, the performance differences between the
algorithms will decrease.
4. The SSTF algorithm is biased toward the middle cylinders in much the same way the
SCAN algorithm is. Since, in the SSTF algorithm, the closest cylinder is always chosen,
then all middle cylinder references will serviced on the way to the end of the disk. The
center of the disk is the location having the smallest average distance to all other tracks.
Thus the disk head tends to move away from the edges of the disk. Here is another way to
think of it. The current location of the head divides the cylinders into two groups. If the
head is not in the center of the disk and a new request arrives, the new request is more
197
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
likely to be in the group that includes the center of the disk; thus, the head is more likely
to move in that direction.
5.
A. New requests for the track over which the head currently resides can theoretically arrive
as quickly as these requests are being serviced.
B. All requests older than some predetermined age could be "forced" to the top of the queue,
and an associated bit for each could be set to indicate that no new request could be moved
ahead of these requests. For SSTF, the rest of the queue would have to be reorganized
with respect to the last of these "old" requests.
C. To prevent unusually long response times.
D. Paging and swapping should take priority over user requests. It may be desirable for other
kernel-initiated I/O, such as the writing of file system metadata, to take precedence over
user I/O. If the kernel supports real-time process priorities, the I/O requests of those
processes should be favored.
Unit Five
Deadlock
Summary
198
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
released. Sometimes the processes are not released; the resources are blocked by some other
processes. This situation is said to be deadlock.
General Objective
Specific Objective
P2 2000 2750
P3 0034 6656
P4 2354 4356
P5 0332 0652
P2 1000 1750
P3 1354 2356
P4 0632 0652
200
P5 0014 0St.6Mary’s
5 6 University College
Faculty of Informatics
Degree Exit Exam Study Guides
a) What is the content of the need matrix?
b) Is the system in safe state?
c) If a request from P1 arrives for (0, 4, 2, 0) can the request be granted
immediately?
5. Explain about the deadlock prevention methods.
Answer Key
1. Request , Use and Release
2. A safe state is a state of the system in which the system can allocate resources to equal
process in some order and still avoid a deadlock.
201
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Unit Six
File Management
Summary
Computers can store information on different storage media, such as magnetic disks,
tapes, and compact disks. The physical storage is converted into logical storage unit by the
operating system. The logical storage unit is said to be file. To perform all these activities the
operating system must include the file management system, which is the collection of system
software that provides services to the users. The files are allocated in the storage media using
202
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
contiguous method, linked method and grouped method. However, the files are accessed through
Sequential Method, Direct Method and Indexed Sequential Method.
General Objective
To understand the file management system that provides services to the users.
Specific Objective
Identify all the file access methods and file allocation methods.
Answer Key
1. Contiguous method, Linked method and Grouped method
3. The advantage is that while accessing a block that is stored at the middle of a file, its
location can be determined by chasing the pointers stored in the FAT as opposed to
accessing all of the individual blocks of the file in a sequential manner to find the pointer
to the target block. Typically, most of the FAT can be cached in memory and therefore
the pointers can be determined with just memory accesses instead of having to access the
disk blocks.
204
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
Part II
Computer Organization
&
Assembly Language Programming
Unit One
Summary
This unit introduce basic computer and shows how its operation can be specified with
register transfer statements. The organization of the computer is defined by its internal registers,
the timing and control structure and the set of instructions that it uses. The design of the
computer s then carried out in detail. Although the basic computer presented in this unit is very
small compared to commercial computers, it has the advantage of being simple enough so that it
can demonstrate the design process without too many complications.
205
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
General Objective
To understand how to design the control logic circuits of registers in basic computer.
Specific Objective
At the end of this chapter the readers are expected to:
2. Derive the Boolean expression for the control logic circuits of memory read.
206
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
3. Derive the Boolean expression for the control logic circuits of memory write.
4. What are the two instructions needed in the basic computer in order to set the E flip-flop
to 1?
Answer Key
1. The Boolean expression for the control logic of AR is given as
2. The Boolean expression for the control logic of memory read is given as
3. The Boolean expression for the control logic of memory write is given as
Unit Two
Summary
In computer system there are two major tasks, which are program execution and I/O
operations. The program execution is the responsibility of CPU and I/O operation is the
responsibility of the IOP and still the CPU is responsible for initiating the I/O devices and IOP.
Input – Output processor is the co-processor that helps the CPU to handle the data transfer
operation through DMA.
General Objective
207
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
To understand the co-processor that enhances the performance of the CPU during the I/O
data transfers.
Specific Objective
At the end of the unit the readers are expected to:
Distinguish between Programmed I/O mode, Interrupt – driven mode and Direct Memory
access (DMA) mode.
4. When do you think that the DMAC sends an interrupt signal to CPU?
5. Why do you think that the DMAC sends interrupt signal to CPU?
208
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
3. List the different types of interrupts.
Answer Key
1. Three I/O communication modes are Programmed I/O mode, Interrupt – driven I/O mode
and direct memory access (DMA).
2. The CPU idle time is very high which in turn reduces the throughput.
3. The interrupt exist as program interrupts, timer interrupts, I/O interrupts and hardware
interrupts.
4. When the data is transferred completely (DC= 0) and when the status of I/O devices
changes from ready to not ready.
Unit Three
Summary
The speed at which the operation performed in computer system depends on the speed of
processor. But later the system performance of the system was not improved that much, hence
the parallel processing concepts has be launched to entertains more than one processor. Michael
Flynn’s has come up with four different types of architecture: SISD, MISD, SIMD and MIMD.
However, all the instruction were not suiting parallel processing and decomposing the sequential
instruction into different independent segments to prepare the instruction that suits for parallel
processing was another challenging issue. Then the pipelining has been introduced to solve this
problem. The computer set instruction exists as RISC and CISC.
209
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
General Objective
To understand parallel computing, pipelining and instruction set based computer.
Specific Objective
At the end of this unit the readers are expected to:
210
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
4. What is pipeline?
Answer Key
1. SISD, SIMD, MISD and MIMD
Unit Four
Summary
Applications that are not time-critical or only operate on standard input/output devices
have minimal direct need for assembly language programming. Otherwise, assembly language is
used to program time critical tasks. Moreover, some programmers must write the library routines
to achieve standard interfaces and these routines are written in assembly language. Assembly
language Programs consist of statement, one per line. Each statement is either an instruction,
which the assembler translate into machine code, or an assembler directive, which instructs the
assembler to perform some specific task, such as allocating memory space for a variable or
creating a procedure. Both instruction and directive have up to four fields. Each line of source
211
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
code consists of a single statement, of up to 512 characters. Statements can be entered in either
uppercase or lowercase letters. Each field (except the comment field) must be separated from
other fields by space or tab character.
General Objective
To understand how the system level programming and real life application is possible
using low level programming languages.
Specific Objective
At the end of this unit the readers are expected to:
Distinguish between Execution unit and Bus interface unit of 8086 microprocessor.
AX = 5;
DX = 6;
212
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
4. Write the formula used to find the effective address of the following instructions?
a) MOV AX, [BX] [SI]
b) MOV BX, 50H [BX] [SI]
5. Assuming that CX contains 0055H when the instruction DEC CH is executed, what will CX
contains and how will the flags CF, PF, SF, and ZF be set afterwards if all were Zero
before execution of instruction.
JCXZ DOWN
JMP UP
AND AX, CX
MOV DX, AX
ADD DX, CX
Answer Key
1. One byte
2. Data directive
3. The content of
a) AX is Unknown c) DX is Unknown
b) CX is Unknown d) BX is Unknown
4. The content of CX is 0000H
5. a) Buffer DB 5DUP (0,?) b) Buffer DB 125DUP( 5DUP(4)
6. Both instructions are used to load the offset address of variable MSG to DX
register.
7. The physical address is A5CA6H
8. The physical memory location address is 5FEC0H.
9. The TASM based program for the problem is:
. MODEL SMALL
. STACK 100H
. DATA
SOURCE_STRING DB ' COLLEGE $'
DESTINATION_STRING DB 20 DUP (?)
. CODE
. STARTUP
214
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides
MOV AX, @DATA
MOV DS, AX
MOV ES, AX
LEA SI, SOURCE_STRING
MOV CL, 07
LEA DI, DESTINATION_STRING
CLD
UP: MOV AL,[SI]
STOSB
LOOP UP
LEA DX, DESTINATION_STRING
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
END
215
St. Mary’s University College
Faculty of Informatics
Degree Exit Exam Study Guides