Академический Документы
Профессиональный Документы
Культура Документы
DOS:13-09-10
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.
Answer:-
The editing actually occurs by mapping of viewing buffer to a window . it is
accomplished by the two components of system.
First component formulates an ideal view. This view may be a very simple one
consisting of window worth of text arranged so that lines are not broken in
the middle of words. Second component takes this initialized from viewing
component and map it to a physical output device in most effective
manner.first component works in main memory and second in disk file file
system.
Loading an entire document into main memory may be infeasible however, if
only part of document is loaded and if many user specified operation
required to locate the affected portion.
PART - B
David START 0
USING *, 21
L 1, Four
A 1, Length
ST 1,Buffer
Four RESW 1
Length RESW 1
Buffer RESB 4096
END
Answer:-
Pass one:-
Relative mnemonic
Address:- code
0 L 1-(0,21)
4 A 1-(0,21)
8 ST 0-(0,21)
12 _
16 _
Second pass :-
Relative mnemonic
Address code
0 L 1-(0,21)
4 A 1-(0,21)
8 ST 1-(0,21)
12 _
16 _
Q5: An assembler can tell loader which part of object code needs
modification, how modification can be done in this case.
Answer:-
Since the assembler does not know the actual location where the program
will be loaded, it cannot make the necessary changes in the address used
by the program. However, the assembler can identify for the loader those
parts of the object program that needs modification. An object program
that contains necessary information to perform this kind of modification is
called relocation program.
The figure below shows how a program is loaded, beginning at address
0000.
JSUB instruction is loaded at address 0006. Consider that the address field
of this instruction contains 01036, which is the address of the instruction
labeled RDREC. Now suppose we want to load this program beginning at
address 5000 as shown in fig 2. The address of this instruction labeled
RDREC is then 6036.
Thus the JSUB instruction must be modified as shown to contain this new
address. Likewise, if we loaded the program beginning at address 7420
(fig 3), the JSUB instruction would need to be changed to 4b108456 to
correspond to the new address of RDREC.
Note that no matter where the program is loaded, RDREC is always 1036
bytes part the starting address of the program. This means that we can
solve relocation problem in the following way.
1. When the assembler generates the opcode for JSUB, we are
considering, it will insert the address RDREC relative to the start of
the program.
2. The assembler will also produce a command for the loader, instructing
it to add the beginning address of the program to the address field in
the JSUB instruction at the load time.
The command for the loader, of course must also be a part of the object
program. We can accomplish modification record having the following
format.
The length is stored in half bytes rather than bytes because the address
field to be modified may not occupy an integral number of bytes.
In pass 2 ,the assembler scans each source statement the second time as
the assembler translates each instruction ,it increments the value contained
in the location counter .when a symbol appear in the source code but not in
symbol table after the programmer corrects all the assembly errors, the
program ready to be executed