You are on page 1of 4

Q1: A user after traveling through all line and viewing it decides to

change all occurrences of ‘’inbox’’ to ‘’spam’’. With the help of


structure of editors tell how replacement actually going to occur.
Ans: While moving all occurrences from inbox to spam, all the processes done by the
editors and while editing it undergoes from various components which are in the structure
of editor. And these components are: Viewing Component, Travelling Component,
Editing component, Display Component.

The structure of editor:

This structure totally joins the user to the hardware and software.

Components of structure of editor:


1. Viewing Component: viewing component helps for viewing the data. It helps to
view the pointer. This component contains two further components i.e. viewing
filter and viewing buffer. It generate the next view.
2. Traveling Component: It selects the area to be edit.
3. Editing Component: This component contains editing buffer and editing filter. It
selects the area to be edited by the user. It stores the data in the editing buffer and
data is loaded in the memory from the buffer.
4. Display Component: It displays the output results.
Q2: How we can interlink Components of system program all together,
elaborate diagrammatically.
Ans: Diagram for components of system program:

Components of system program:

 Source code: Source code is what the programmer or user write for the accurate
results and outputs. It is then compiled by the compiler.
 Compiler: compiler uses to compile the source code. Compiler actually converts
the high level language to the machine understandable language i.e. assembly
language.
 Assembly language: Assembly language is the machine understandable
language. The code in this language comes from the compiler and goes to the
assembler and converts to the object code.
 Assembler: Assembler converts assembly language to object code.
 Object code: Object code is a code comes from the assembler. It is totally
machine understandable language.
 Loader: Loader loads the object code into the memory for the execution.
 Linker: Linker separates the relocation and loading. It performs the linking
operation.

Q3: Is it necessary to have viewing filters and viewing buffers in


structure of editors, if yes then how they help in managing the text.
Ans: Yes, it is necessary to have viewing filters and viewing buffers in structure of
editors. While editing user has to view the document and this viewing process is done by
the viewing filter and viewing buffer. Viewing component maintain the viewing pointer.
The viewing filters component filters the document to generate a new viewing buffer to
display the output. Viewing filter is used to extracting the relevant subset. Viewing buffer
contains part of the document to be viewed from current viewing pointer. In line editors
viewing buffer may contain the current line.
Viewing filter is attached to main memory so it contains the update data to be viewed.
PART - B

Q4: Generate passes of assemblers for following code---

David START 0
USING *, 21
L 1, Four
A 1, Length
ST 1,Buffer
Four RESW 1
Length RESW 1
Buffer RESB 4096
END
Ans:

PASS1
Relative Address Mnemonic Code
0 L 1, __ (0, 21)
4 A 1, __ (0, 21)
8 ST 1, __ (0, 21)
12 4
16 _
20 _

PASS2

Relative Address Mnemonic Code


0 L 1, 12 (0, 21)
4 A 1, 16 (0, 21)
8 ST 1, 20 (0, 21)
12 4
16 _
20 _

Q5: An assembler can tell loader which part of object code needs
modification, how modification can be done in this case.
Ans: An assembler can tell loader which part of object code needs modification. This is
a machine dependent feature. Assembler itself identifies the address of the modification.
As when user changes the starting address of the code then the relative address in the
code automatically changes which is in the assembler so assembler can tell the loader
which part of the object code needs modification.
Q6: Is there any need to design the pass2 of an assembler? Can we
generate both the passes in a single pass, if yes how?
Ans: Yes, there is a need to design the pass 2 of an assembler. Pass1 scan the source
code and then segregate the literals, symbols. It generates tables and pass2 generates the
object code from the addresses of pass1.

Yes, we can generate both the passes in a single pass. This single pass is a combination of
pass1 and pass2. Single pass eliminate the forward reference in symbol reference.

You might also like