SS 2 marks

Embed Size (px)

Citation preview

  • 7/31/2019 SS 2 marks

    1/18

    MARTHANDAM COLLEGE OF ENGINEERING AND TECHNOLOGYDEPARTMENT OF INFORMATION TECHNOLOGY

    SEMESTER 05CS 54- SYSTEM SOFTWARE

    Prepared ByD. NAVIS NAYAGAMAssistant Professor

    UNIT IINTRODUCTION

    1. Define System Software.It consists of variety of programs that supports the operation of the computer. It makes itpossible for the user to focus on the other problems to be solved without needing to knowhow the machine works internally.

    2. Distinguish between System Software & application software.

    3. Define hypothetical computer model.Hypothetical computer is an imaginary computer that has been designed to include the

    hardware features mostly found on real machinesEg: SIC, SIC-XE

    4. Give the instructions format of SIC.All machine instructions on the standard version of SIC have the following 24-bitformat:

    The flag bit X is used to indicate the indexed addressing mode

    5. Give the instruction set of SIC.Load and store instructions (LDA, LDX, STA, STX)Integer arithmetic operations (ADD, SUB, MUL, DIV)Comparison operation (COMP)Conditional Jump operations (JLT, JEQ, JGT)Jump to Subroutine instruction (JSUB)Return to Subroutine (RSUB)

  • 7/31/2019 SS 2 marks

    2/18

    6. Define compiler and interpreter.Compiler is a set of program which converts the whole high level language program tomachine language program.Interpreter is a set of programs which converts high level language program to machine

    language program line by line.

    7. What are the registers used in SIC?There are 5 registers in SIC machine. Each register is 24 bits in length

    8. What are the registers used in SIC/XE?

    9. Give any two differences between base relative addressing and program counter relativeaddressing used in SIC/XE.

    Base Relative Addressing Program Counter Relative Addressing

    Target address is calculated using theformulaTA = Displacement + Contents of baseregister

    Target address is calculated using theformulaTA= Displacement + contents ofProgram Counter register

    Displacement lies between 0 to 4095 Displacement lies between -2048 to2047

    10. Write down the use of the status word (SW) register.Status word contains Condition Code (CC) information. The result of a comparison

    operation affects the condition codes in the status register. Condition code is also used tocheck whether a device is ready or busy.

  • 7/31/2019 SS 2 marks

    3/18

    11. Define program counter relative mode of addressing.In Program-counter mode of addressing, the target address is calculated by adding

    displacement and the content of program counter.

    12. Define immediate addressing.In this addressing mode the operand value is given directly as a part of theinstruction itself. There is no need to refer memory. The immediate addressing isindicated by the prefix #.Eg: ADD #5

    In this instruction one operand is in accumulator and the second operand is animmediate value the value 5 is directly added with the accumulator content and the result isstored in accumulator.

    13. What is the use of TD instruction in SIC architecture?The test device (TD) instruction tests whether the addressed device is ready to send or

    receive a byte of data. The condition code is set to indicate the result of this test. Settingof < means the device is ready to send or receive, and = means the device is not ready.

    14. How system software is different from Application Software?The most important characteristic in which most system software differs from

    application software is machine dependency. An application program is primarily concernedwith the solution to some problem, using computer as a tool. The focus is on the application,not on the application system. System programs, on the other hand, are intended to supportthe operation and use of the computer itself, rather than any particular application. They areusually related to the architecture of the machine on which they are to run.

    15. Define indirect addressing mode in SIC/XE.In the case of indirect addressing word at the given location given by the target

    address is fetched. The value contained in this word is then taken as the address of theoperand value

    Eg: J @ RETADR

    16. List any four addressing modes of SIC/XEBase relative addressing mode, Program counter relative addressing mode,

    immediate addressing and indirect addressing modes

    17. How floating-point data type is represented in SIC/XE version?The floating point data type size is 48 bits and it is represented as follows

    The fraction is interpreted as a value between 0 and 1. The exponent is anunsigned binary number between 0 and 2047. The sign of the floating point number isrepresented by S. (0=Positive and 1 = Negative)

  • 7/31/2019 SS 2 marks

    4/18

    18. What is the use of SVC instruction in SIC/XE?A special supervisor call instruction is provided by SIC XE, which when executed

    generates an interrupt that can be used for communicating with the operating system.

    19. Define upward compatibility in systems.An object program for the standard SIC machine will also execute on a SIC XE

    system. This is known as upward compatibility. Such upward compatibility is found inreal world computers which are closely related to one another.

    20. What are the important machine structures used in the design of system software?Memory structure

    RegistersData formatsInstruction formats

    Addressing modesInstruction set

    21. Compare RISC and CISC machines.

    RISC CISC

    It contains less No of Instructions It contains more No of Instructions

    It has more registers It has less registers

    Reduced Instruction set Computer Complex Instruction set Computer

    E.g. VAX, Pentium Pro E.g. Ultra SPARC, Power PC

  • 7/31/2019 SS 2 marks

    5/18

    UNIT IIASSEMBLERS

    1. What is an Assembler?An assembler is a program that accepts an assembly language program as input

    and produces its machine language equivalent along with information for the loader

    2. What is meant by assembler directives? Give example.The assembler directives are not translated into machine instructions, but they

    provide instructions to assembler itself.Eg: START, END, BYTE, WORD, RESW and RESB.

    3. What are the basic functions of an assembler?

    Convert mnemonic operation codes to their machine language equivalents

    E.g. STL -> 14

    Convert symbolic operands to their equivalent machine addresses

    E.g. RETADR -> 1033 Build the machine instructions in the proper format

    Convert the data constants to internal machine representations

    E.g. EOF -> 454F46

    Write the object program and the assembly listing

    4. What is the format of the Object Program generated by the Assembler?Contains 3 types of records:

    Header record:

    Col. 1 HCol. 2-7 Program name

    Col. 8-13 Starting address (hex)Col. 14-19 Length of object program in bytes (hex)Text record:

    Col.1 TCol.2-7 Starting address in this record (hex)Col. 8-9 Length of object code in this record in bytes (hex)Col. 10-69 Object code (hex) (2 columns per byte)End record:Col.1 ECol.2~7 Address of first executable instruction (hex)

    5. What is forward reference?Forward reference is a reference to a label that is defined later in the program.Example10 STL RETADR

    RETADR is not yet defined when we encounter STL instruction

    So it is called forward reference

    6. What are the Data Structures used in an Assembler?

  • 7/31/2019 SS 2 marks

    6/18

    Operation Code Table (OPTAB)Symbol Table (SYMTAB)Location Counter (LOCCTR)

    7. What is the need of SYMTAB (symbol table) in assembler?

    The symbol table includes the name and value for each symbol in the sourceprogram, together with flags to indicate error conditions. Sometimes it may containsdetails about the data area. SYMTAB is usually organized as a hash table for efficiencyof insertion and retrieval.

    8. What is Location Counter?Location Counter is a variable used to help in assignment of addresses. It is

    initialized to the beginning address specified in the START statement. It is incrementedbased on the size of the instruction in bytes.

    9. What is the need of OPTAB (operation code table) in assembler?

    The operation code table contains the mnemonic operation code and its machinelanguage equivalent. Some assemblers may also contain information about instructionformat and length. OPTAB is usually organized as a hash table, with mnemonic operationcode as the key.

    10. Define re-locatable program.An object program that contains the information necessary to perform required

    modification in the object code depends on the starting location of the program duringload time is known as re-locatable program.

    11. What are the advantages of program relocation?The advantages of program relocation are as follows,

    Several programs can be loaded and run at the same time. This kind of sharing of

    the machine between programs is called multiprogramming

    Load programs into memory wherever there is room

    There is no need to assign a fixed address at assembly time

    12. Differentiate absolute expression and relative expression.If the result of the expression is an absolute value (constant) then it is known as

    absolute expression.E.g.: BUFEND BUFFERIf the result of the expression is relative to the beginning of the program then it is

    known as relative expression. Label on instructions and data areas and references to thelocation counter values are relative terms.

    E.g.: BUFEND + BUFFER

  • 7/31/2019 SS 2 marks

    7/18

    13. Define load and go assembler.One pass assembler that generates their object code in memory for immediate

    execution is known as load and go assembler. Here no object programmer is written outand hence there is no need for loader.

    14. What are the two different types of jump statements used in MASM assembler?Near jumpA near jump is a jump to a target in the same segment and it is assembled by

    using a current code segment CS.Far jump

    A far jump is a jump to a target in a different code segment and it is assembled byusing different segment registers.

    15. Differentiate the assembler directives RESW and RESB.RESW It reserves the indicated number of words for data area.Eg: 10 1003 THREE RESW 1

    In this instruction one word area(3 bytes) is reserved for the symbol THREE. Ifthe memory is byte addressable then the address assigned for the next symbol is1006.RESB It reserves the indicated number of bytes for data area.Eg: 10 1008 INPUT RESB 1In this instruction one byte area is reserved for the symbol INPUT .Hence theaddress assigned for the next symbol is 1009.

    16. Define modification record and give its formatThe modification record contains the information about the modification in the object

    code during program relocation. The general format isCol 1 MCol 2-7 Starting location of the address field to be modified relative to the

    beginning of the programCol 8-9 Length of the address field to be modified in half bytes.

    17. What is meant by external references?Assembler program can be divided into many sections known as control sections and

    each control section can be loaded and relocated independently of the others. If theinstruction in one control section needs to refer instruction or data in another control section,the assembler is unable to process these references in normal way. Such references betweencontrol sections are called external references.

    18. Define control section.A control section is a part of the program that maintain its identity after assembly;

    each control section can be loaded and relocated independently of the others. Controlsections are most often used for subroutines. The major benefit of using control sectionsis to increase flexibility.

  • 7/31/2019 SS 2 marks

    8/18

    19. What is the difference between the assembler directive EXTREF and EXTDEFEXTDEF names external symbols that are defined in a particular control section

    and may be used by other sections.EXTREF names external symbols that are referred in a particular control section

    and defined in another control section.

    20. Give the general format of define record.This record gives information about external symbols that are defined in a particular

    control section. The format isCol 1 DCol 2-7 Name of external symbol defined in this control sectionCol 8-13 Relative address of the symbol with in this control sectionCol 14-73 Name and relative address for other external symbols.

    21. What is a multi-pass assembler?

    A multi-pass assembler is an assembler that can make as many passes that are neededto process the definitions of symbols.

  • 7/31/2019 SS 2 marks

    9/18

    UNIT IIILOADERS AND LINKERS

    1. Define Loading, Linking and Relocation.Loading brings the object program into memory for executionLinking combines two or more separate object programs and supplies theinformation needed to reference themRelocation modifies the object program so that it can be loaded at an addressdifferent from the location originally specified

    2. Define absolute loaderThe loader which is used only for loading an absolute object program to a fixed

    address is called an absolute loader. It is not capable of performing relocation.

    3. What is a bootstrap loader?When a computer is first tuned on or restarted, a special type of absolute loader,the bootstrap loader loads the first program (usually Operating System) to be run intomemory

    4. What are re-locatable loaders? What are the different methods for specifying relocation?Loaders that allow for program relocation are called relocating loaders.

    Modification records- Suitable for a small number of relocations required whenrelative or immediate addressing modes are extensively usedRelocation bits- Suitable for a large number of relocations required when onlydirect addressing mode can be used in a machine with fixed instruction format(e.g. the standard SIC machine)

    5. What is the use of modification record?Modification record is used for program relocation. Each modification record

    specifies the starting address and the length of the field whose value is to be altered andalso describes the modification to be performed.

    6. What do you mean by a bitmask?The relocation bits are gathered following the length indicator field in the text

    record, which is called the bit mask. For e.g. the bit mask FFC (111111111100) specifiesthat the first 10 words of object code are to be modified during relocation.

    7. What is the need of ESTAB?It is used to store the name and address of the each external symbol. It also

    indicates in which control section the symbol is defined.

  • 7/31/2019 SS 2 marks

    10/18

    8. What is the use of the variable PROGADDR?It gives the beginning address in memory where the linked program is to be

    loaded. The starting address is obtained from the operating system. It becomes theaddress of the first control section.

    9. What is the use of the variable CSADDR?CSADDR contains the starting address assigned to the control section currentlybeing scanned by the loader

    10. Give the two passes of a linking loader.Pass1: assigns address to all external symbolsPass2: it performs actual loading, relocation and linking.

    11. Define automatic library search.In many linking loaders the subroutines called by the program being loaded are

    automatically fetched from the library, linked with the main program and loaded. This

    feature is referred to as automatic library search.

    12. List the loader options INCLUDE &DELETE.The general format of INCLUDE isINCLUDE program_name (library name)

    This command directs the loader to read the designated object program from a library andtreat it as the primary loader input.The general format of DELETE command is

    DELETE Csect-name

    It instructs the loader to delete the named control sections from the sets of programsloaded.

    13. Give the functions of the linking loader.The linking loader performs the process of linking and relocation. It includes the

    operation of automatic library search and the linked programs are directly loaded into thememory.

    14. Give the difference between linking loader and linkage editors.

    Linking Loader Linkage Editor

    relocation and linking isperformed each timethe program is loaded

    produces a linked version of aprogram andwhich is written in a file for laterexecution

    Two passes are required Here the loading can beaccomplished in a single pass

  • 7/31/2019 SS 2 marks

    11/18

    15. Define dynamic linking or dynamic loading.If the subroutine is loaded and linked to the program during its first call (run

    time), then it is called as dynamic loading or dynamic linking. In dynamic linking, thelinking function is postponed until execution time.

    16. Give the advantages of dynamic linking.a) It has the ability to load the routine only when they are neededb) The dynamic linking avoids the loading of entire library for each executionc) It saves substantial time and memory spaced) Allow several executing programs to share one copy of a subroutine or library

    17. List the disadvantages of absolute loader.For an absolute loader, the address at which the program is to be loaded must be

    specified beforehand. Also, it is not possible to load just the required subroutines alone.Thus it is disadvantageous as it is inefficient in terms of both space and execution time.

    18. What is the advantage of reference-number mechanism?The reference-number mechanism assigns a reference number to each externalsymbol referred to in a control section. This reference number is used in modificationrecords. The advantage of this mechanism is that it avoids multiple searches of ESTABfor the same symbol during the loading of a control section. An external referencesymbol can be looked up in ESTAB once for each control section that uses it. The valuesfor code modification can be obtained by simply indexing into an array of these values.

    19. Define Linkage Editor.A linkage editor produces a linked version of the program, called a load module

    or an executable image, which is written to a file or library for later execution. When theuser is ready to run the linked program, a simple relocating loader can be used to load theprogram into memory. The loading can be achieved in a single pass.

    20. Define MS-DOS Linker.MS-DOS Linker is a linkage editor that combines one or more object modules to

    produce a complete executable program.

  • 7/31/2019 SS 2 marks

    12/18

    UNIT IVMACRO PROCESSORS

    1. What do you mean by a macro?

    A macro represents the commonly used group of statements in the sourceprogramming language. It allows the programmer to write a short hand version of theprogram.

    2. Define macro processor.Macro processor is system software that replaces each macroinstruction with the

    corresponding group of source language statements. This is also called as expanding ofmacros.

    3. Give the general structure of a Macro Definition?MACROS are defined using two assembler directives MACRO and MEND. The

    statements inside these directives called as MACRO body that is defined with the macroname. The structure of macro definition is

    Macroname MACRO ParametersStatement 1Statement 2

    . Macro Body

    .Statement AMEND

    4. What are the data structures used in macro processor?DEFTAB the macro definitions are stored in a definition table i.e., it contains amacro prototype and the statements that make up the macro body.

    NAMTAB it is used to store the macro names and it contains two pointers foreach macro instruction which indicate the starting and end location of

    macro definition in DEFTAB. It also serves as an index to DEFTABARGTAB it is used to store the arguments during the expansion of macro

    invocations.

    5. Define conditional macro expansion.If the macro is expanded depends upon some conditions in macro definition

    (depending on the arguments supplied in the macro expansion) then it is called asconditional macro expansion.

    6. What is a macro time variable?Macro time variable can be used to store working values during the macro

    expansion. Any symbol that begins with the character & and then is not a macroinstruction parameter is assumed to be a macro time variable.

  • 7/31/2019 SS 2 marks

    13/18

    7. What is meant by positional parameters?If the parameters and arguments were associated with each other according to

    their positions in the macro prototype and the macro invocation statement, then theseparameters in macro definitions are called as positional parameters.

    8. Consider the macro definition#Define DISPLAY (EXPR) Printf(EXPR = %d\n,EXPR)

    Expand the macro instruction DISPLAY (X).Ans: Printf (EXPR = %d\n, X)

    9. What is a nested macro call?The statement in which a macro calls on another macro is called nested macro

    call. In the nested macro call, the call is done by outer macro and the macro called is theinner macro.

    10. How the macro is processed using two passes?Pass1: processing of definitionsPass 2: actual-macro expansion.

    11. What is meant by line by line processor?This macro processor reads the source program statements, process the statements

    and then the output lines are passed to the language translators as they are generated,instead of being written in an expanded file.

    12. What is meant by general-purpose macro processors?The macro processors that are not dependent on any particular programming

    language, but can be used with a variety of different languages are known as generalpurpose macro processors.Eg.The ELENA macro processor.

    13. What is the symbol used to generate unique labels?$ Symbol is used in macro definition to generate unique symbols. Each macro

    expansion the $ symbol is replaced by $XX, where XX is the alpha numeric character.

    14. How the nested macro calls are executed?The execution of nested macro call is done using a stack using the Last in First

    out rule. In case of nested macro calls the expansion of the latest macro call is completedfirst.

    15. What is the difference between a Macro and a subroutine?The statements that form the body of the macro are generated each time a macro

    is expanded.Statements in a subroutine appear only once, regardless of how many times the

    subroutine is called.

  • 7/31/2019 SS 2 marks

    14/18

    16. What are the machine independent features of macro processors?

    Concatenation of macro parameters

    Generation of unique labels

    Conditional macro expansion

    Keyword Macro Parameters

    17. What is meant by concatenation of macro parameter?Most macro processors allow parameters to be concatenated with other character

    string. Suppose that the parameter to such a macroinstruction is named &ID. The body ofthe macro definition might contain a statement like: LDA X&ID in which the parameter&ID is concatenated after the character string X.

    18. List the features of MASM macro processor.

    The macro processor of MASM is integrated with Pass 1 of the assembler.

    Macros may be redefined within the program without causing an error.

    In MASM macro processor the conditional macro expansion statements are called

    CONDITIONAL ASSEMBLY statements. The macro parameters in MASM need not begin with & or any other special

    character.

    The end of the macro is marked by ENDM.

    19. What is the purpose of conditional compilation statement in ANSI C preprocessor?These statements can be used to be sure that a macro is defined at least once.

    E.g. #ifndef Buffer-size#define Buffer-size 1024#endif

    The statements will be processed only if buffer-size has not already been defined.

    20. What are positional parameters? How do they differ from keyword parameters?

    Positional parameters are the one that are supplied with MACRO directive in themacro definition. Here the parameters and arguments (given in macro call ) wereassociated, with each other according to their positions in the macro prototype and themacro invocation statement.In keyword parameter, the argument value is written with a keyword that names thecorresponding parameter. Arguments may be any order here.

    E.g. Positional ArgumentSTRG DATA1,DATA2, DATA3GENER ,, DIRECT,,,,3

    Keyword ArgumentSTRG a3 = DATA1 , a2= DATA2, a1= DATA3GENER TYPE = DIRECT, CHANNEL = 3.

  • 7/31/2019 SS 2 marks

    15/18

    UNIT- V

    1. Define interactive editor?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, text, equations,

    tables, diagrams, line art, and photographs any thing that one might find on a printed page.

    2. What are the tasks performed in the editing process?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.

    3. What are the three categories of editors devices?1. Text device/ String devices

    2. Button device/Choice devices

    3. Locator device

    4. What is the function performed in editing phase?

    In the actual editing phase, the target document is created or altered with a set ofoperations such as insert, delete, replace, move and copy.

    5. What is a Locator device?Locator devices are two-dimensional analog-to-digital converters that position a cursor

    symbol on the screen by observing the users movement of the device. The most common such

    devices for editing applications are the mouse and the data tablet.

    6. What are called tokens?

    The lexical analyzer tracks the source program one character at a time by making the

    source program into sequence of atomic units is called tokens.

    7. Name some of typical tokens.Identifiers, keywords, constants, operators and punctuation symbols such as commas and

    parentheses are typical tokens.

  • 7/31/2019 SS 2 marks

    16/18

    8. What is meant by lexeme?The character that forms a token is said to be a lexeme.

    9. Mention the main disadvantage of interpreter.The main disadvantage of interpreter is that the execution time of interpreted program is

    slower than that of a corresponding compiled object program.

    10. What is meant by code optimization?The code optimization is designed to improve the intermediate code, which helps the

    object program to run faster and takes less space.

    11. What is error handler?The error handler is used to check if there is an error in the program. If any error, it

    should warn the programmer by instructions to proceed from phase to phase.

    12. Name some of text editors.a) line editorsb) stream editorsc) screen editorsd) word processorse) structure editors

    13. What for debug monitors are used?Debug monitors are used in obtaining information for localization of errors.

    14. Mention the features of word processors.

    a) Moving text from one place to another

    b) Merging of text

    c) Searching

    d) Word replacement

    15. What are the phases in performing editing process?a. Traveling phase

    b. Filtering phase

    c. Formatting phase

    d. Editing phase

    16. Define traveling phase.The phase specifies the region of interest. Traveling is achieved using operations such as

    next screenful, bottom, find pattern.

  • 7/31/2019 SS 2 marks

    17/18

    17. Define Filtering phase.The selection of what is to be viewed and manipulated in given by filtering.

    18. Define Editing phaseIn this phase, the target document is altered with the set of operations such as insert,

    delete, replace, move and copy.

    19. Define user interface?

    User interface is one, which allows the user to communicate with the system in order toperform certain tasks. User interface is generally designed in a computer to make it easier to use.

    20. Define input device?Input device is an electromechanical device, which accepts data from the outside world

    and translates them into a form, which the computer can interpret.

    21. Define output devicesOutput devices are used to view the elements being edited and the results of the editing

    operations.

    22. What are the methods in Interaction language of a text editor?a. Typing oriented or text command oriented method

    b. Function key interfaces

    c. Menu oriented method

    23. Define interactive debugging systemsAn interactive debugging system provides programmers with facilities that aid in the

    testing and debugging of programs.

    24. Define editor structure.The command language processor accepts input from the users input devices and

    analyzes the tokens and syntactic structure of the commands.

    25. What are the basic types of computing environments used in editors functions?Editor function in three basic types of computing environments

    a. Time sharingb. Stand-alonec. Distributed

  • 7/31/2019 SS 2 marks

    18/18

    26. Define tracing?Tracing is a debugging technique used to track the flow of execution logic and datamodifications.

    27. Define Trace back?Trace back is a debugging technique used to Show the path by which the currentstatement was reached.

    27. What is the function of command language processor?It accepts inputs from the users and analyses tokens and syntactic structure of

    commands.

    28. Write about viewing component of the editor.In viewing a document, the start area to be viewed is determined by the current

    viewing pointer. This pointer is maintained by viewing component of the editor. Viewingcomponent is a collection of modules responsible for determining the next view.