Model Answer of System Software B. Tech. (4 th Semester Examination) Paper Code: AR-9083 Branch: Information Technology Time Allowed: 3hours Maximum Marks: 100 Part-A (All questions are compulsory) Objective Type Questions (1*10=20Marks) Q.1. is device where information is stored. (a)data (b) Program (c) memory (d) File. Memory Q.2. is a hardware memory device which denotes the location of current instruction being executed (a) Instruction Counter (b) counter (c) templates (d) none of these. Instruction Counter Q.3. Which of the following loader is executed when a system is first turned on or restarted. (a) Boot loader (b) Compile and Go loader (c) Bootstrap loader (d) Relating loader Bootstrap loader Q.4. Nested Macro calls are expanded using the
(a) FIFO rule (First in first out) (b) LIFO (Last in First out) (c) FILO rule (First in last out) (d) None of these Q.5.In this operant form AREA +5(4) here 5 is the. (a) Pointer (b) Displacement (c) coding (d) none of these. Displacement Q.6.The primary function performed by the analysis phase is the building of the. (a) symbol Table (b) hashing (c) Localization (d) none of these. Symbol Table Q.7. expansion implies generation of instruction tailored to the requirements of a specific usage. (a) Semantic (b) next expansion (c) last expansion (d) none of these. Semantic Q.8.A model statement in a macro may constitute a call on another macro, such calls are known as calls. (a) Generated (b) nested (c) first (d) none of these. Nested Q.9. address assigned by the loader (a) load time (b) translate time (c) linked time (d) none of these. Load time. Q.10.Load origin assigned by while loading the program for execution.
(a) Linker, (b) programmer (c) Loader (d) none of these. Loader Short Answer Type Questions (2*5=10Marks) Q.1.What is memory? Fig.1. Memory hierarchy The smallest unit of memory is the "bit". A bit can be in one of two states on vs. off, or alternately, 1 vs. 0. Technically any object that can have two distinct states can remember one bit of information. This has been done with magnets, gear wheels, and tinker toys, but almost all computers use little transistor circuits called "flip-flops" to store bits. The flip-flop circuit has the property that it can be set to be in one of two states, and will stay in that state and can be read until it is reset. Q.2.Define Process?
Fig.2.Process in CPU. A process is an instance of a program running in a computer. It is close in meaning to task,. A process is started when a program is initiated (either by a user entering a shell command or by another program). Like a task, a process is a running program with which a particular set of data is associated so that the process can be kept track of. A process can initiate a sub process, which is a called a child process (and the initiating process is sometimes referred to as its parent). A child process is a replica of the parent process and shares some of its resources, but cannot exist if the parent is terminated. Q.3.Define Compiler?
Fig.3 A compiler is a program that translates human readable source code into computer executable machine code. To do this successfully the human readable code must comply with the syntax rules of whichever programming language it is written in. The compiler is only a program and cannot fix your programs for you. If you make a mistake, you have to correct the syntax or it won't compile. Q.4. what is interrupts in C? Fig.4 An interrupt is a hardware mechanism that enables an external device, typically I/O devices, to send a signal to the CPU. An interrupt signal requests the CPU to interrupt its current activities
and attend to the interrupting device s needs. A CPU will check interrupts only after it has completed the processing of one instruction and before it fetches a subsequent one Q.5.Define intermediate code? Fig.5 An intermediate code is basically governed during the process of conversion from analysis phase to synthesis phase of assembler. And the intermediate code is between translator and code generator. Section B Each Question carries 8 marks. (Long answer type questions 8*5 =40 Marks) Note: Attempt any one questions out of two questions from each unit. Unit 1 Q.1. Explain in detail the following terms (a) Memory Address Registers (b)memory Buffer Registers
Fig.6 Memory address Register (MAR): MAR holds the memory location of data that needs to be accessed. When reading from memory, data addressed by MAR is fed into the MDR (memory data register) and then used by the CPU. When writing to memory, the CPU writes data from MDR to the memory location whose address is stored in MAR. Memory Buffer Registers (MBR): A Memory Buffer Register (MBR) is the register in a computer's processor, or central processing unit, CPU, that stores the data being transferred to and from the immediate access store. It acts as a buffer allowing the processor and memory units to act independently without being affected by minor differences in operation. A data item will be copied to the MBR ready for use at the next clock cycle, when it can be either used by the processor or stored in main memory. Q.2. Explain pointer in detail, its various declaration methods? Pointer is a variable that stores value of address of a variable. Since pointer itself is a variable, it is allocated a memory location. Pointer to pointer is a pointer which points to the address of a pointer. In other words a pointer to pointer has the address of address of a variable.
Consider the declaration, Int i = 3 ; This declaration tells the C compiler to: (a) Reserve space in memory to hold the integer value. (b) Associate the name i with this memory location. (c) Store the value 3 at this location. Example. Meaning of following simple pointer declaration int a=5; int * ptr; ptr=&a; Explanation: About variable a: 1. Name of variable : a 2. Value of variable which it keeps: 5 3. Address where it has stored in memory : 1025 (assume) About variable ptr: 4. Name of variable : ptr 5. Value of variable which it keeps: 1025 6. Address where it has stored in memory : 5000 (assume) Unit 2 Q.1.Explain the types of interrupt in detail?
Fig.7 Interrupts alter a program s flow of control its behavior is similar to a procedure call, interrupts causes transfer of control to an interrupt service routine (ISR), it is also called a handler. Interrupts provide an efficient way to handle unanticipated events. Various Ways of Interacting with I/O Device Fig.8 Types of Interrupt A. Software Interrupt B. Hardware Interrupt
C. Exceptions Interrupt A. Software Interrupt: Software interrupt is basically Initiated by executing an interrupt instruction int interrupt-type,interrupt-type is an integer in the range 0 to255. Each interrupt type can be parameterized to provide several services. For example, DOS interrupt service int 21H provides more than 80 different services; AH register is used to identify the required service under int 21H. As with DOS functions, AH is used to identify the required service. B. Hardware Interrupt: Fig. 9 Hardware interrupts are of hardware origin and asynchronous in nature. Typically it is caused by applying an electrical signal to the Processor chip Hardware interrupts can be Mask able and Non-mask able. C. Exceptions Interrupt: Exceptions Interrupt are divided in to three parts, depends on the way they are reported. Faults and traps are reported at instruction boundaries (a) Faults: It is in the instruction boundaries during which the execution was detected, it restart the instruction, it also detected during div/idiv instruction. (b)traps: Instruction boundary immediately after the instruction during, which the exception was detected. It is not allowing any instruction to restart.
(c) Aborts: Abort interrupt sever errors such as hardware errors, and inconsistent values in system tables. Q.2.Explain in detail the hardware interrupts? Fig. 10 Hardware interrupts are of hardware origin and asynchronous in nature. Typically it is caused by applying an electrical signal to the Processor chip Hardware interrupts can be Mask able and Non-mask able.
Non-maskable interrupt is triggered by applying an electrical signal to the MNI pin of Pentium and Processor always responds to this signal it cannot be disabled under program control. Maskable interrupt is triggered by applying an electrical signal to the INTR (INTerrupt Request) pin of Pentium. Pentium recognizes this interrupt only if IF (interrupt enable flag) is set. Interrupts can be masked or disabled by clearing IF. For hardware interrupts, CPU initiates an interrupt known as acknowledge sequence. CPU sends out interrupt acknowledge (INTA) signal in response, interrupting device places interrupt type number on the data bus. CPU uses this number to invoke the ISR that should service the device (as in software interrupts) Unit 3 Q.1.Explain in detail the advantages of Assembly Languages?
Fig.11 The Primary advantages of assembly language programming vis -a - vis machine language programming arise from the use symbolic operant specification.assembly language holds an
edge over HLL(High level language ) programming. Assembly language programming uses the special instruction support by the CPU. It processes the source statements in a text file to produce a relocate able object file. It produces a source listing (if requested) and provides you with control over this listing. It allows you to divide your code into sections and maintain a section program counter (SPC) for each Section of object code. It defines and references global symbols and appends a cross-reference listing to the source listing (if requested) It also allows conditional assembly It supports macros, allowing you to define macros inline or in a library. Q.2.Describe the specification of Assembler? Ans. Fig.12
The basic specification of Assembler is as followed in four steps. a. Identify the information necessary to perform a task. b. Design a suitable data structure to record the information c. Determine the processing necessary to obtain and maintain the information d. Determine the necessary processing to perform the task. The data structure used during the synthesis phase are symbol table and mnemonic table, and the primery function of analysis phase is the building of symbol table. Analysis Phase. a.isolate the label, mnemonic opcode operand fields of a statement. b.if a label is present, enter the pair in a new enter of a symbol table c.check the validity of the mnemonic opcode d. Perform LC processing Synthesis Phase a. Obtain the machine opcode corresponding to the mnemonic from the mnemonic table. b. obtain the address from the symbol table c. synthesize the machine instruction Unit 4 Q.1.Explain in detail the semantic expansion in macro expansion? Semantic expansion implies generation of instruction tailored to the requirement of a specific usage.
Semantic expansion is characterized by the fact that different uses of a macro can lead codes which differ in number, sequence and opcode instruction. Example. The following sequence of instruction is used to increment the value in memory word by a constant. a. Move the value from the memory word in to a Machine register. b. Increment the value in the machine register. c. Move the new value in to the memory word Q.2.Explain in detail the concept of macro calls? A macro is called by writing a macro name in the mnemonic field of an assembly statement. the macro call has the syntax <macro name>[<actual parameter spec> [,..]] Where actual parameter typically resembles an opcode specification in an assembly language statement. Unit 5 Q.1.Explain the concept of relocation in detail?
Fig.13 Program relocation is the process of modifying the address used in the address sensitive instruction of a program such that the program can execute correctly from the designated are of the memory Relocation is basically consists of a. An address sensitive instruction: A set of absolute address, instruction or data. b. An address constant: A data word which contain the address of sensitive instruction Relocation is the process of shifting the address of memory from static to dynamic binding of memory address of an instruction. Q.2. Explain the concept of Linking in detail?
Fig.14 Linking is basically consist of a. Public definition : a symbol pub_symb defined in a program unit which may be reference in other program units. b. External reference: a reference to symbol ext_symbol which is not defined in the program unit containing the reference.
Linking is the process of binding an external reference to the correct link time address.external reference is said to be unresolved until linking is performed for it. It is said to be resolved when its linking is completed. Finely linking load the executable file in the memory for the further execution of program.