System Software Notes
System Software Notes
Software notes
Monday, 8 April 2013
UNIT-I
INTRODUCTION
Definition of System software:
System software consists of a variety ofprograms that support the
operation of a computer.
Examples:
Text editor, compiler, loader or linker,debugger, macro processors, operating
system,database management systems, softwareengineering tools, etc.
I.SYSTEM SOFTWARE AND MACHINE ARCHITECTURE
One characteristic in which most system software differs from application
software is machine dependency
System software – support operation and use of computer. Application
software - solution to a problem
System programs are intended to support the operation and use of the
computer itself, rather than any particular application.
Example:
Assemblers translate mnemonic instructions into machine code, the instruction
formats, addressing modes, etc., are of direct concern in assembler design.
Compilers generate machine code, taking into account such hardware
characteristics as the number and type of registers & machine instruction
available.
Operating system concerned with the management of nearly all resources of a
computing system.
There are some aspects of system software that do not directly depend
upon the type of computing system being supported ie Machine independency.
Example:
Mostly Assembler’s general design and logic is basically same on all
computers.
Compilers use some code optimization techniques like common subexpression
elimination, dead-code elimination etc.
The process of linking is also machine independent.
Because most system software is machinedependent, we must include
real machines and real pieces of software in our study.
Simplified Instructional Computer (SIC)
SIC is a hypothetical computer that has been carefully designed to
include the hardware features most often found on real machines, while
avoiding unusual or irrelevant complexities.
II.THE SIMPLIFIED INSTRUCTIONAL COMPUTER (SIC)
SIC comes in two versions
SIC (Standard model)
XE (“extra equipment”) “extra equipments”, “extra expensive”
The two versions have been designed to be upward compatible, ie., an
object program for the standard SIC machine will also execute properly on a
SIC/XE system.
1.SIC MACHINE ARCHITECTURE:
Memory:
opcode
4 C
Format 2 (2 bytes)
8 4 4
Op r1 r2
Example: COMPR A,S(Compare the contents of registers A & S)
Opcod e A S
1010 0000 0000 0100
8-bit 4-bit 4-bit
2 bytes
A 0 0 4 object code
Format 3(3 bytes)
6 1 1 1 1 1 1 12
Op N i x b p e Disp
6 1 1 1 1 1 1 12
0000 00 0 1 0 0 0 0 0000 0000 0011
Opcode n I x b p e
0 1 0 0 0 3 object code
Format 4(4 bytes)
6 1 1 1 1 1 1 20
Op N i x b p e address
In addition to SIC, there are I/O channels that can be used to perform
input and output while CPU is executing other instructions. This allows overlap
of computing and I/O, resulting in more efficient system operation.
The instruction are
Arithmetic Operations:
Looping and Indexing operations:
Input Output operations:
Subroutine Calls:
UNIT II
ASSEMBLERS
Definition:
Assembler is system software which is used to convert an assembly
language program to its equivalent object code.
The input to the assembler is a source code written in assembly
language (using mnemonics) and the output is the object code. Assigning
machine addresses to symbolic labels
The design of an assembler depends upon the machine architecture as
the language used is mnemonic language.
Source
Program ASSEMBLERObject Code
The basic assembler functions are:
Translating mnemonic language code to its equivalent object code.
Assigning machine addresses to symbolic labels.
The design of assembler in other words:
Convert mnemonic operation codes to their machine language equivalents
Convert symbolic operands to their equivalent machine addresses
Decide the proper instruction format Convert the data constants to internal
machine representations
Write the object program and the assembly listing.
Inaddition to the mnemionic machine instructions, the assembly language
program contains the following assembler directives.
START: Specify name & starting address.
END: End of the program, specify the first execution instruction.
BYTE: Generate character or hexadecimal constant, occupying as many
bytes as needed to represent the constant.
WORD: Generate one word integer constant.
RESB: Reserve the indicated number of bytes for a data area.
RESW: Reserve the indicated number of words for a data area.
Figure 2.1 Shows the assembler language program for the basic version
Fig 2.2 shows the same program as in Fig 2.1, with the generated object code
for each statement.
LOC Gives the machine address for each part of the assembled program.
Line numbers for references and not part of the program.
The first pass scans the source program for label definitions and assigns
addresses.
The second pass performs most of the actual translation.
In addition to translating the instructions of the source program, the
assembler must process statements called assembler directives (or pseudo-
instructions). These statements are not translated into machine instructions.
Instead they provide instructions to the assembler itself.
Example: BYTE and WORD, which direct the assembler to generate
constants as part of the object program.
The assembler must write the generated object code onto some output device.
This object program will later be loaded into memory for execution.
The simple object program format contains three types of records
Headercontain program name, starting address and length.
Texttranslated instructions and data of the program.
Endmarks the end of the object program.
End Record
Col.1 E
Col.2-7 Address of first executable instruction in object program
(hexadecimal)
Functions of the two passes of simple assembler
Pass 1(define symbols)
1. Assign addresses to all statements in the program
2. Save the values(addresses) assigned to all labels for use in pass 2.
3. Perform some processing of assembler directives.
SYMTAB: This table includes the name and value for each label in the source
program, together with flags to indicate the error conditions (e.g., if a symbol is
defined in two different places).
During Pass 1: labels are entered into the symbol table along with their assigned
address value as they are encountered. All the symbols address value should get
resolved at the pass 1.
During Pass 2: Symbols used as operands are looked up the symbol table to
obtain the address value to be inserted in the assembled instructions.
SYMTAB is usually organized as a hash table for efficiency of insertion
and retrieval. Since entries are rarely deleted, efficiency of deletion is the
important criteria for optimization.
LOCCTR:
LOCCTR is initialized to the beginning address mentioned in the
START statement of the program.
After each statement is processed, the length of the assembled instruction
is added to the LOCCTR to make it point to the next instruction. Whenever a
label is encountered in an instruction the LOCCTR value gives the address to be
associated with that label.
There is certain information (such as location counter values and error flags
for statements) that can or should be communicated between the two passes. For
this reason, Pass 1 usually writes an inter-mediate file that contains each source
statement together with its assigned address, error indicators, etc. This file is
used as the input to Pass 2.
Figures 2.4 (a) and (b) (Page 53~54) show the logic flow of the two passes of our
assembler.
Here the first input line is read from the intermediate file.
If the opcode is START, then this line is directly written to the list file. A
header record is written in the object program which gives the starting address
and the length of the program (which is calculated during pass 1).
Then the first text record is initialized. Comment lines are ignored. In the
instruction, for the opcode the OPTAB is searched to find the object code.
If a symbol is there in the operand field, the symbol table is searched to
get the address value for this which gets added to the object code of the opcode.
If the address not found then zero value is stored as operands address. An
error flag is set indicating it as undefined. If symbol itself is not found then store
0 as operand address and the object code instruction is assembled.
If the opcode is BYTE or WORD, then the constant value is converted to
its equivalent object code( for example, for character EOF, its equivalent
hexadecimal value ‘454f46’ is stored).
If the object code cannot fit into the current text record, a new text record is
created and the rest of the instructions object code is listed. The text records are
written to the object program.
Once the whole program is assemble and when the END directive is
encountered, the End record is written.
II.MACHINE-DEPENDENT ASSEMBLER FEATURES:
Instruction formats and addressing modes
Programrelocation
The starting location field of a modification record is the location of the byte
containing the leftmost bits of the address field to be modified.
Example:
The modification record for the +JSUB instruction would be
“M00000705”.
This record specifies that the beginning address of the program is to be
added to a field that begins at address 000007 (relative to the start of the
program) and is 5 half-bytes in length.
Suppose some of the instructions are not required to be modified because:
The operand of the instruction is not a memory address.
Operand is using PC-relative or base relative addressing modes.
Obviously, the only parts of the program that require modification at load
time are those that specify direct (as opposed to relative) addresses.
Fig 2.8 shows the complete object program corresponding to the source
program of Fig 2.5.
All of the literal operands used in a program are gathered together into
one or more literal pools. Normally literals are placed into a pool at
the end of the program.
In some cases,places literals into a pool at some other location in
the object program. To allow this we introduce the assembler directive
LTORG.
Whenever the LTORG is encountered, it creates a literal pool that
contains all the literal operands used since the beginning of the
program. The literal pool definition is done after LTORG is encountered.
It is better to place the literals close to the instructions.
A literal table is created for the literals which are used in the
program. The literal table contains the literal name, operand value and
length. The literal table is usually created as a hash table on the literal
name.
1.When the assembler encounters a LTORG statement, it creates a literal pool that
contains all of the literal operands used since the previous LTORG (or the
beginning of the program).
2. This literal pool is placed in the object program at the location where the LTORG
directive was encountered (Fig 2.10).
3. Of course, literals placed in a pool by LTORG will not be repeated in the pool at
the end of the program.
If we had not used the LTORG statement on line 93, the literal =C’EOF’
would be placed in the pool at the end of the program.
Most assemblers recognize duplicate literals – that is, the same literal used in
more than one place in the program – and store only one copy of the specified
data value. For example, the literal =X’05’ is used in our program on lines 215
and 230.
How to find the duplicate literals? The easiest way to recognize duplicate
literals is by comparison of the character strings defining them (the string
=X’05’).
The basic data structure that assembler handles literal operands isliteral
table LITTAB. For each literal used, this table contains theliteral name,
the operand value and length, and the address assigned to the operand when it is
placed in a literal pool.
LITTAB is often organized as a hash table, using the literal name or value as
the key. During pass 1, the assembler searches LITTAB for the specified literal
name (or value). If the literal is already present in the table, no action is needed.
If it is not present, the literal is added to LITTAB (leaving the address
unassigned).
During pass 2, the operand address for use in generating object code is obtained
by searching LITTAB for each literal operand encountered.
2. Symbol-Defining Statements
EQU Statement:
With this information the assembler can easily determine the type of each
expression used as an operand and generate modification recoprds in the object
programm for relative values.
4.Program Blocks:
Program blocks are referred to be segments of code that are rearranged
within a single object program unit, and control sections (appeared in next
subsection) to be segments that are translated into independent object program
units.
Fig 2.11 shows our example program, as it might be written using program
blocks.
Three blocks are used: The first (unnamed) program block contains the
executable instructions of the program. The second (named CDATA) contains
all data areas that are a few words or less in length. The third(named CBLKS)
contains all data areas that consist of larger blocks of memory.
Fig 2.14 traces the blocks of the example program through this process of assembly
and loading.
A control section is a part of the program that maintains its identity after
assembly; each such control section can be loaded and relocatedindependently
of the others. Different control sections are most often used for subroutines or
other logical subdivisions of a program.
Control sections differ from program blocks in that they are handled
separately by the assembler
Fig 2.15 shows three control sections: The first section continues (from
COPY) till the CSECT statement on line 109.
The assembler must include information in the object program that will
cause the loader to insert the proper values where they are required.
We need two new record types (Define and Refer) in the object program.
A Define record gives information about external symbols that are defined in
this control section – that is, symbols named by EXTDEF. (The record format
see page 89)
A Refer record lists symbols that are used as external reference by the control
section – that is, symbols named by EXTREF.
Fig 2.17 shows the object program corresponding to the source in Fig 2.16.
Notice that there is a separate set of object program records for each
control section.
Example: The address field for the JSUB on line 15 begins at relative address
0004. Its initial value in the object program is zero. The Modification record
‘M00000405+RDREC’ in control section COPY specifies that the address of
RDREC is to be added to this field, thus producing the correct machine
instruction for execution.
Example: The handling of line 190. The value of this word is to be
BUFEND-BUFFER, where both BUFEND and BUFFER are defined in
another control section. The assembler generates an initial value of zero for this
word. The last two Modification records in RDREC direct that the address of
BUFEND be added to this field, and the address of BUFFER be subtracted from
it. This computation, performed at load time, results in the desired value for the
data word.
5.ASSEMBLER DESIGN
One-Pass Assembler
Multi-Pass Assembler
1. One-Pass Assembler
The main problem in designing the assembler using single pass was to
resolve forward references.
We can avoid to some extent the forward references by:
Eliminating forward reference to data items, by defining all the storage
reservation statements at the beginning of the program rather at the end.
Unfortunately, forward reference to labels on the instructions cannot be
avoided. (forward jumping)
To provide some provision for handling forward references by prohibiting
forward references to data items.
There are two types of one-pass assemblers:
One that produces object code directly in memory for immediate execution
(Load-and-go assemblers).
The other type produces the usual kind of object code for later execution.
Load-and-Go Assembler
Load-and-go assembler generates their object code in memory for immediate
execution.
No object program is written out, no loader is needed.
It is useful in a system with frequent program development and testing
The efficiency of the assembly process is an important consideration.
Programs are re-assembled nearly every time they are run; efficiency of the
assembly process is an important consideration.
A Load-and-go assembler avoids the overhead of writing the object program
out and reading it back in.
Forward Reference in One-Pass Assemblers:
In load-and-Go assemblers when a forward reference is encountered :
Omits the operand address if the symbol has not yet been defined
Enters this undefined symbol into SYMTAB and indicates that it is undefined
Adds the address of this operand address to a list of forward references
associated with the SYMTAB entry
When the definition for the symbol is encountered, scans the reference list and
inserts the address.
At the end of the program, reports the error if there are still SYMTAB entries
indicated undefined symbols.
For Load-and-Go assembler
o Search SYMTAB for the symbol named in the END statement and jumps to this
location to begin execution if there is no error
After Scanning line 40 of the program:
40 2021 J` CLOOP 302012
The status is that upto this point the symbol RREC is referred once at
location 2013, ENDFIL at 201F and WRREC at location 201C. None of these
symbols are defined.
The below figure shows the object code and symbol table entries as they
would be after scanning line 40 of the program and shows that how the pending
definitions along with their addresses are included in the symbol table.
The first forward reference occurred on line 15. Since the operand
(RDREC) was not yet defined, the instruction was assembled with no value
assigned as the operand address (denoted by ----).
RDREC was then entered into SYMTAB as an undefined symbol
(indicated by *); the address of the operand field (2013) of the instruction was
inserted in a list associated with RDREC.
A similar process was followed with the instructions on lines 30 and 35.
The status after scanning line 160, which has encountered the definition of
RDREC and ENDFIL is as given below:
By this time, some of the forward references (ENDFIL, line 45 and
RDREC, line 125) have been resolved, while others (EXIT, line 175 and
WRREC, line 210) have been added.
When the symbol ENDFIL was defined (known), the assembler placed its
value in the SYMTAB entry; it then inserted this value into the instruction
operand field (at address 201C) as directed by the forward reference list.
From this point on, any references to ENDFIL would not be forward
references, and would not be entered into a list.
At the end of the program, any SYMTAB entries that are still marked with *
indicate undefined symbols. These should be flagged by the assembler as errors.
One-pass assemblers that produce object programs follow a slightly different
procedure from that previously described.
1) Forward references are entered into lists as before.
2) When the definition of a symbol is encountered, instructions that made
forward references to that symbol may no longer available in memory for
modification. In general, they will already have been written out as part of a
Text record in the object program. In this case, the assembler must
generateanother Text record with the correct operand address.
3) When the program is loaded, this address will be inserted into the instruction
by the action of the loader.
Fig 2.20 illustrates the above process.
The 2nd Text record contains that object code generated from lines 10
through 40 in Fig 2.18. The operand addresses for the instructions on lines 15,
30, and 35 have been generated as 0000.
When ENDFIL on line 45 is encountered, the assembler generates the
rd
3 Text record. This record specifies that the value 2024 (the address of
ENDFIL) is to be loaded at location 201C (the operand address field of JEQ on
line 30).
When the program is loaded, the value 2024 will replace the 0000
previously loaded.
2. Multi-Pass Assembler:
For a two pass assembler, forward references in symbol definition are not
allowed:
ALPHA EQU BETA
BETA EQU DELTA
DELTA RESW 1
o Symbol definition must be completed in pass 1.
Prohibiting forward references in symbol definition is not a serious
inconvenience.
o Forward references tend to create difficulty for a person reading the program.
The symbol BETA cannot be assigned a value when it is
encountered during the first pass because DELTA has not yet been defined. As
a result, ALPHA cannot be evaluated during the second pass.
This means that any assembler that makes only two sequential
passes over the source program cannot resolve such a sequence of definitions.
Multi-Pass Assembler Example Program
Fig 2.21(b) displays symbol table entries resulting from Pass 1 processing of the
statement. The entry &1 indicates that one symbol in the defining expression is
undefined.
Fig 2.21(c) shows two undefined symbols involved in the definition: BUFEND
and BUFFER.
Fig 2.21(f) shows that when BUFEND is defined, MAXLEN and HALFSZ can
be determined accordingly.
5. Implementaion Examples:
MASM Assembler:
UNIT III
LOADERS AND LINKERS
For a simple absolute loader, all functions are accomplished in a single pass as
follows:
1) The Header record of object programs is checked to verify that the correct
program has been presented for loading.
2) As each Text record is read, the object code it contains is moved to the indicated
address in memory.
3) When the End record is encountered, the loader jumps to the specified address to
begin execution of the loaded program.
Fig 3.1(b) shows a representation of the program from Fig 3.1(a) after loading.
Fig 3.2 shows an algorithm for the absolute loader
relocation.
For example, the value for reference REF4 in PROGA is located at address
4054 (the beginning address of PROGA plus 0054). Fig 3.10(b) shows the
details of how this value is computed.
The initial value (from the Text record) is 000014. To this is added the address
assigned to LISTC, which 4112 (the beginning address of PROGC plus 30).
3. Algorithm and Data Structures for a Linking Loader
The algorithm for a linking loader is considerably more complicated than
the absolute loader algorithm.
A linking loader usually makes two passes over its input, just as an
assembler does. In terms of general function, the two passes of a linking loader
are quite similar to the two passes of an assembler: Pass 1 assigns addresses to
all external symbols.
Pass 2 performs the actual loading, relocation, and linking.
The main data structure needed for our linking loader is an external symbol
table ESTAB. This table, which is analogous to SYMTAB in our assembler
algorithm, is used to store the name and address of each external symbol in the
set of control sections being loaded.
A hashed organization is typically used for this table.
Two other important variables are PROGADDR (program load address)
and CSADDR (control section address).
PROGADDR is the beginning address in memory where the linked
program is to be loaded. Its value is supplied to the loader by the OS.
CSADDR contains the starting address assigned to the control section
currently being scanned by the loader. This value is added to all relative
addresses within the control section to convert them to actual addresses.
The algorithm is presented in Fig 3.11.
During Pass 1 (Fig 3.11(a)), the loader is concerned only with Header and
Define record types in the control sections.
2. Dynamic Linking
Linkage editors perform linking operations before the program is loaded for
execution.
Linking loaders perform these same operations at load time.
Dynamic linking, dynamic loading, or load on call postpones the linking
function until execution time: a subroutine is loaded and linked to the rest of the
program when it is first called.
Dynamic linking is often used to allow several executing programs to share one
copy of a subroutine or library, ex. run-time support routines for a high-level
language like C.
With a program that allows its user to interactively call any of the subroutines
of a large mathematical and statistical library, all of the library subroutines
could potentially be needed, but only a few will actually be used in any one
execution.
Dynamic linking can avoid the necessity of loading the entire library for each
execution except those necessary subroutines.
Fig 3.14 illustrates a method in which routines that are to be dynamically
loaded must be called via an OS service request.
Fig 3.14(a): Instead of executing a JSUB instruction referring to an external
symbol, the program makes a load-and-call service request to OS. The
parameter of this request is the symbolic name of the routine to be called.
Fig 3.14(b): OS examines its internal tables to determine whether or not the
routine is already loaded. If necessary, the routine is loaded from the specified
user or system libraries.
Fig 3.14(c): Control is then passed from OS to the routine being called
Fig 3.14(d): When the called subroutine completes it processing, itreturns to its
caller (i.e., OS). OS then returns control to the program that issued the request.
Fig 3.14(e): If a subroutine is still in memory, a second call to it may not
require another load operation. Control may simply be passed from the dynamic
loader to the called routine.
3. Bootstrap Loaders
On some computers, an absolute loader program is permanently resident
in a read-only memory (ROM). When some hardware signal occurs, the
machine begins to execute this ROM program. This is referred to as a bootstrap
loader.
Reads a fixed-length record form some device into memory at a fixed
location.
After the read operation is complete, control is automatically transferred
to the address in memory.
If the loading process requires more instructions than can be read in a
single record, this first record causes the reading of others, and these in turn can
cause the reading of more records.
UNIT IV
MACRO PROCESSORS
A macro instruction (abbreviated to macro) is simply a notational convenience
for the programmer.
• A macro represents a commonly used group of statements in the source
programming language
• Expanding a macros
Replace each macro instruction with the corresponding group of source
language statements
Example:
On SIC/XE requires a sequence of seven instructions to save the contents of all
registers
• Write one statement like SAVERGS
• A macro processor is not directly related to the architecture of the computer on
which it is to run
• Macro processors can also be used with high-level programming languages,
OS command languages, etc.
I.Basic Processor Functions:
Macro Definition and Expansion
Macro Processor Algorithms and Data structures
The WHILE statement specifies that the following lines, until the next
ENDW statement, are to be generated repeatedly as long as a particular
condition is true. Note that all the generation is done at the macro expansion
time. The conditions to be tested involve macro-time variables and arguments,
not run-time data values.
UNIT V
SYSTEM SOFTWARE TOOLS
I.TEXT EDITORS
1.Overview of the editing process
An interactive editor is a computer program that allows a user to create
and revise a target document.The term document includes objects such as
computer programs, texts, equations, tables, diagrams, line art and photographs-
anything that one might find on a printed page. Text editor is one in which the
primary elements being edited are character strings of the target text.
The document editing process is an interactive user-computer dialogue
designed to accomplish four tasks:
1) Select the part of the target document to be viewed and manipulated
2) Determine how to format this view on-line and how to display it.
3) Specify and execute operations that modify the target document.
4) Update the view appropriately.
Traveling – Selection of the part of the document to be viewed and edited. It
involves first traveling through the document to locate the area of interest such
as “next screenful”, ”bottom”,and “find pattern”. Traveling specifies where the
area of interest is;
Filtering - The selection of what is to be viewed and manipulated is controlled
by filtering. Filtering extracts the relevant subset of the target document at the
point of interest such as next screenful of text or next statement.
Formatting: Formatting determines how the result of filtering will be seen as a
visible representation (the view) on a display screen or other device.
Editing: In the actual editing phase, the target document is created or altered
with a set of operations such as insert, delete, replace, move or copy.
Manuscript oriented editors operate on elements such as single
characters, words, lines, sentences and paragraphs;
Program-oriented editors operates on elements such as identifiers,
keywords and statements.
2. User-interface
The user of an interactive editor is presented with a conceptual model of
the editing system. The model is an abstract framework on which the editor and
the world on which the operations are based.
The line editors simulated the world of the keypunch they allowed
operations on numbered sequence of 80-character card image lines.
The Screen-editors define a world in which a document is represented as
a quarter-plane of text lines, unbounded both down and to the right. The user
sees, through a cutout, only a rectangular subset of this plane on a multi line
display terminal. The cutout can be moved left or right, and up or down, to
display other portions of the document.
The user interface is also concerned with the input devices, the output
devices, and the interaction language of the system.
Input devices:
The input devices are used to enter elements of text being edited, to enter
commands, and to designate editable elements.
Input devices are categorized as:
1) Text devices
2) Button devices
3) Locator devices
1) Text or string devices are typically typewriter like keyboards on which user
presses and release keys, sending unique code for each key. Virtually all
computer key boards are of the QWERTY type.
2) Button or Choice devices generate an interrupt or set a system flag, usually
causing an invocation of an associated application program. Also special
function keys are also available on the key board. Alternatively, buttons can be
simulated in software by displaying text strings or symbols on the screen. The
user chooses a string or symbol instead of pressing a button.
3) Locator devices: They are two-dimensional analog-to-digital converters that
position a cursor symbol on the screen by observing the user‟s movement of the
device. The most common such devices are the mouseand the tablet.
The Data Tablet is a flat, rectangular, electromagnetically sensitive
panel. Either the ballpoint pen like stylus or a puck, a small device similar to a
mouse is moved over the surface. The tablet returns to a system program the co-
ordinates of the position on the data tablet at which the stylus or puck is
currently located. The program can then map these data-tablet coordinates to
screen coordinates and move the cursor to the corresponding screen position.
Text devices with arrow (Cursor) keys can be used to simulate locator
devices. Each of these keys shows an arrow that point up, down, left or right.
Pressing an arrow key typically generates an appropriate character sequence; the
program interprets this sequence and moves the cursor in the direction of the
arrow on the key pressed.
Voice-input devices: which translate spoken words to their textual equivalents,
may prove to be the text input devices of the future. Voice recognizers are
currently available for command input on some systems.
Output devices The output devices let the user view the elements being edited
and the result of the editing operations.
The first output devices were teletypewriters and other character-printing
terminals that generated output on paper.
Next “glass teletypes” based on Cathode Ray Tube (CRT) technology which
uses CRT screen essentially to simulate the hard-copy teletypewriter.
Today‟s advanced CRT terminals use hardware assistance for such features
as moving the cursor, inserting and deleting characters and lines, and scrolling
lines and pages.
The modern professional workstations are based on personal computers with
high resolution displays; support multiple proportionally spaced character fonts
to produce realistic facsimiles of hard copy documents.
Interaction language:
The interaction language of the text editor is generally one of several
common types.
The typing oriented or text command-oriented method
It is the oldest of the major editing interfaces. The user communicates
with the editor by typing text strings both for command names and for operands.
These strings are sent to the editor and are usually echoed to the output device.
Typed specification often requires the user to remember the exact form
of all commands, or at least their abbreviations. If the command language is
complex, the user must continually refer to a manual or an on-line Help
function. The typing required can be time consuming for in-experienced users.
Function key interfaces:
Each command is associated with marked key on the key board. This
eliminates much typing. E.g.: Insert key, Shift key, Control key
Disadvantages: Have too many unique keys
Multiple key stroke commands
Menu oriented interface
A menu is a multiple choice set of text strings or icons which are
graphical symbols that represent objects or operations. The user can perform
actions by selecting items for the menus.
The editor prompts the user with a menu. One problem with menu oriented
system can arise when there are many possible actions and several choices are
required to complete an action. The display area of the menu is rather limited.
3.Editor Structure
The command Language Processor
It accepts input from the user‟s input devices, and analyzes the tokens
and syntactic structure of the commands. It functions much like the lexical and
syntactic phases of a compiler. The command language processor may invoke
the semantic routines directly. In a text editor, these semantic routines perform
functions such as editing and viewing.
The semantic routines involve traveling, editing, viewing and display
functions. Editing operations are always specified by the user and display
operations are specified implicitly by the other three categories of operations.
Traveling and viewing operations may be invoked either explicitly by the user
or implicitly by the editing operations.
Editing Component
In editing a document, the start of the area to be edited is determined by
the current editing pointer maintained by the editing component, which is the
collection of modules dealing with editing tasks. The current editing pointer can
be set or reset explicitly by the user using travelling commands, such as next
paragraph and next screen, or implicitly as a side effect of the previous editing
operation such as delete paragraph.
Traveling Component
The traveling component of the editor actually performs the setting of the
current editing and viewing pointers, and thus determines the point at which the
viewing and /or editing filtering begins.
Viewing Component
The start of the area to be viewed is determined by the current viewing
pointer. This pointer is maintained by the viewing component of the editor,
which is a collection of modules responsible for determining the next view. The
current viewing pointer can be set or reset explicitly by the user or implicitly by
system as a result of previous editing operation.
The viewing component formulates an ideal view, often expressed in a
device independent intermediate representation. This view may be a very simple
one consisting of a window‟s worth of text arranged so that lines are not broken
in the middle of the words.
Display Component
It takes the idealized view from the viewing component and maps it to a
physical output device in the most efficient manner. The display component
produces a display by mapping the buffer to a rectangular subset of the screen,
usually a window
Editing Filter
Filtering consists of the selection of contiguous characters beginning at
the current point. The editing filter filters the document to generate a new
editing buffer based on the current editing pointer as well as on the editing filter
parameters
Editing Buffer
It contains the subset of the document filtered by the editing filter based
on the editing pointer and editing filter parameters
Viewing Filter
When the display needs to be updated, the viewing component invokes
the viewing filter. This component filters the document to generate a new
viewing buffer based on the current viewing pointer as well as on the viewing
filter parameters.
Viewing Buffer
It contains the subset of the document filtered by the viewing filter
based on the viewing pointer and viewing filter parameters.
E.g. The user of a certain editor might travel to line 75,and after viewing it,
decide to change all occurrences of “ugly duckling” to “swan” in lines 1
through 50 of the file by using a change command such as
[1,50] c/ugly duckling/swan/
As a part of the editing command there is implicit travel to the first line
of the file. Lines 1 through 50 are then filtered from the document to become
the editing buffer. Successive substitutions take place in this editing buffer
without corresponding updates of the view
In Line editors, the viewing buffer may contain the current line;
inscreen editors, this buffer may contain rectangular cut out of the quarter-plane
of text. This viewing buffer is then passed to the display component of the
editor, which produces a display by mapping the buffer to a rectangular subset
of the screen, usually called a window.
The editing and viewing buffers, while independent, can be related in
many ways. In a simplest case, they are identical: the user edits the material
directly on the screen. On the other hand, the editing and viewing buffers may
be completely disjoint.
Windows typically cover the entire screen or rectangular portion of it. Mapping
viewing buffers to windows that cover only part of the screen is especially
useful for editors on modern graphics based workstations. Such systems can
support multiple windows, simultaneously showing different portions of the
same file or portions of different file. This approach allows the user to perform
inter-file editing operations much more effectively than with a system only a
single window.
The mapping of the viewing buffer to a window is accomplished by two
components of the system.
(i) First, the viewing component formulates an ideal view often
expressed in a device independent intermediate representation. This view
may be a very simple one consisting of a windows worth of text arranged so
that lines are not broken in the middle of words. At the other extreme, the
idealized view may be a facsimile of a page of fully formatted and typeset text
with equations, tables and figures.
(ii) Second the display component takes these idealized views from
the viewing component and maps it to a physical output device the most
efficient manner possible.
The components of the editor deal with a user document on two levels:
(i) In main memory and
(ii) (ii) In the disk file system.
Loading an entire document into main memory may be infeasible.
However if only part of a document is loaded and if many user specified
operations require a disk read by the editor to locate the affected portions,
editing might be unacceptably slow. In some systems this problem is solved by
the mapping the entire file into virtual memory and letting the operating
system perform efficient demand paging.
An alternative is to provide is the editor paging routines which read
one or more logical portions of a document into memory as needed. Such
portions are often termed pages, although there is usually no relationship
between these pages and the hard copy document pages or virtual memory
pages. These pages remain resident in main memory until a user operation
requires that another portion of the document be loaded.
Editors function in three basic types of computing environment:
(i) Time-sharing environment
(ii) Stand-alone environment and
(iii) Distributed environment.
Each type of environment imposes some constraint on the design of an editor
The Time –Sharing Environment
The time sharing editor must function swiftly within the context of the
load on the computer‟s processor, central memory and I/O devices.
The Stand alone Environment
The editor on a stand-alone system must have access to the functions
that the time sharing editors obtain from its host operating system. This may be
provided in pare by a small local operating system or they may be built into the
editor itself if the stand alone system is dedicated to editing.
Distributed Environment
The editor operating in a distributed resource sharing local network must,
like a standalone editor, run independently on each user‟s machine and must,
like a time sharing editor, content for shared resources such as files.
II.INTERACTIVE DEBUGGING SYSTEMS
An interactive debugging system provides programmers with facilities
that aid in testing and debugging of programs interactively.
1.Debugging functions and capabilities
Execution sequencing:
It is the observation and control of the flow of program execution. For
example, the program may be halted after a fixed number of instructions are
executed.
Breakpoints – The programmer may define break points which cause execution
to be suspended, when a specified point in the program is reached. After
execution is suspended, the debugging command is used to analyze the progress
of the program and to diagnose errors detected. Execution of the program can
then be removed.
Conditional Expressions – Programmers can define some conditional
expressions, evaluated during the debugging session, program execution is
suspended, when conditions are met, analysis is made, later execution is
resumed
Gaits- Given a good graphical representation of program progress may even be
useful in running the program in various speeds called gaits.
A Debugging system should also provide functions such as tracing and
traceback.
Tracing can be used to track the flow of execution logic and data
modifications. The control flow can be traced at different levels of detail –
procedure, branch, individual instruction, and so on…
Traceback can show the path by which the current statement in the
program was reached. It can also show which statements have modified a given
variable or parameter. The statements are displayed rather than as hexadecimal
displacements.
Program-display Capabilities
It is also important for a debugging system to have good program display
capabilities. It must be possible to display the program being debugged,
complete with statement numbers.
Multilingual Capability
A debugging system should consider the language in which the program
being debugged is written. Most user environments and many applications
systems involve the use of different programming languages. A single
debugging tool should be available to multilingual situations.
Context Effects
The context being used has many different effects on the debugging interaction.
For example. The statements are different depending on the language
COBOL - MOVE 6.5 TO X
FORTRAN - X = 6.5
Likewise conditional statements should use the notation of the source language
COBOL - IF A NOT EQUAL TO B
FORTRAN - IF (A .NE. B)
Similar differences exist with respect to the form of statement labels,
keywords and so on.
Display of source code
The language translator may provide the source code or source listing
tagged in some standard way so that the debugger has a uniform method of
navigating about it.
Optimization:
It is also important that a debugging system be able to deal with
optimized code. Many optimizations involve the rearrangement of segments of
code in the program.
For eg.
- invariant expressions can be removed from loop
- separate loops can be combined into a single loop
- redundant expression may be eliminated
- elimination of unnecessary branch instructions
The debugging of optimized code requires a substantial amount of
cooperation from the optimizing compiler.
2.Relationship with Other Parts of the System
An interactive debugger must be related to other parts of the system in
many different ways.
Availability
Interactive debugger must appear to be a part of the run-time environment
and an integral part of the system. When an error is discovered, immediate
debugging must be possible because it may be difficult or impossible to
reproduce the program failure in some other environment or at some other
times.
Home
▼ 2013 (1)
o ▼ April (1)
cs1203-SYSTEM SOFTWARE NOTES
About Me
thenkumarisamayal
View my complete profile
Simple theme. Powered by Blogger.