SS QB

PESIT SOUTH CAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK Faculty : Ms. Kakoli Bora No.Of Hours:52 Chapter1: MACHINE AR...

0 downloads 142 Views 117KB Size
PESIT SOUTH CAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK Faculty : Ms. Kakoli Bora

No.Of Hours:52

Chapter1: MACHINE ARCHITECTURE OBJECTIVE: Main Objective is to Know about the system software and architecture of Various Machines Like SIC, SIC/XE and Programming examples of SIC, SIC/XE

1. 2. 3.

4. 5. 6. 7.

8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23.

What is System software? Compare system software with application software and give couple of examples. Explain the instruction formats and addressing modes of SIC/XE machine architecture. Suppose the ALPHA is an array of 100 words. Write a sequence of instructions for SIC/XE to set all 100 elements of the array to ZERO. Use immediate addressing and register to register addressing to make the process as efficient as possible. Bring out the difference between application software and system software. Explain the instruction format of SIC/XE Machine Architecture by clearly mention indicating the setting of different flag bits. Explain the addressing modes of SIC/XE Machine. Write a subroutine in SIC/XE to read a 100-byte record from a device ‘F5’ into BUFFER. Use immediate and register-to-register instructions. Write an assembly program on SIC/XE machine to implement block move form a memory address a1 to another address a2, without overlap. Explain the registers and Instruction formats of SIC/XE. Write a program for SIC/XE to add 2 arrays each having 100 elements & each element 1 word in length and store the result back in memory. With reference to SIC standard version explain instruction format. Explain the architecture of SIC. Explain the architecture of SIC/XE Explain the addressing modes of SIC with an example each. Explain the addressing modes of SIC/XE with an example each. List out registers used in SIC machine architecture along with their use Write a sequence of instructions for SIC/XE to set ALPHA equal to GAMMA * BEETA -9 .(Use register operation.) Write a program in both SIC and SIC/XE to copy a character string ‘System Software’ to another character string. Clearly differentiate between system software and application software Clearly differentiate between SIC an SIC/XE architecture Write a SIC program to transfer 100bytes of data from one array to another array Write a SIC/XE program to transfer 100bytes of data from one array to another array Explain the role of various registers in SIC/XE architecture

PESIT SOUTH CAMPUS-Education for the real world

4* 10* 6* 4 4 6 6 7 8 5* 3 8 8 8 8 7 5 8 6 5 6 6 6

Page 1

PESIT SOUTH CAMPUS

Chapter2: ASSEMBLERS:(unit 2 and unit 3) OBJECTIVE: Deals with assembler, One Pass and Multi Pass assemblers

1. 2. 3. 4. 5. 6. 7. 8.

9.

10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21.

Write and explain the algorithm of PASS-1 of 2 pass assembler.

10

Discuss the need for a two pass assembler and clearly Explain it’s functions. What are the fundamental functions that any assembler must perform? With a suitable example, explain any six assembler directives. Explain the data structures used in assembler algorithms What is program relocation? Explain the problems associated with it and their solutions. Write algorithm of pass 2 of 2 pass assembler. Also, explain briefly the data structures used and for what purpose they are used in pass-2 Explain the need of relocation of a program. Explain how it is implemented. What do you understand by assembler directives? Explain BYTE and RESW with example Generate the complete object program for the following assembly level program. SUM START 0 FIRST CLEAR X LDA #0 +LDB #TOTAL BASE TOTAL LOOP ADD TABLE,X TIX COUNT JLT LOOP STA TOTAL COUNT RESW 1 TABLE RESW 2000 TOTAL RESW 1 END FIRST ASSUMEBELOW OPCODES(all in hexadecimal) CLEAR-B4 LDA-00 LDB-68 ADD-18 TIX-2C JLT-38 STA-OC

10

Explain the machine dependent features of an assembler. Explain the 2-pass algorithm of assembler. Explain any three possible data structure for assembler implementation. Explain the data structures used in the design of an assembler Explain the concept of relocation. Explain the machine independent features of an assembler. Explain how a source program is converted into object program. Give format of the object program and discuss contents of the header and text record. Explain control sections. Write a short note on ORG directive Explain multi-pass assembler. Write a note on MASM assembler. How is Relocation is done using the following: PESIT SOUTH CAMPUS-Education for the real world

10* 6* 4* 14* 6* 4

10

10 10 10 6 10 10 10 10 5 10 10 10 Page 2

PESIT SOUTH CAMPUS 22.

23.

24. 25. 26. 27. 28. 29. 30. 31.

32. 33. 34.

35. 36. 37. 38. 39. 40.

1) Modification Records, 2) Bit Marks. List the assembler direction of SIC/XE and Explain Generate the target address for the following machine instructions Assume Content of x register (x)=0000 Content of B Register (b)=0020 Content of PC Register(pc)=2000 1) 030132 2) 030101450 3) 03213C 4) 038134 5) 03a168 6) 03c172 7) 03a13c 8) 03912636. Explain with the help of an example each the following instructions a. ADDF b. COMPF c. COMPR d. DIVF e. DIVR Explain with the help of an example each the following instructions a. FIX b. FLOAT c. HIO d. NORM e. SIO Explain with the help of an example each the following instructions a. STCH b. LDT c. LDL d. JEQ e. ROM Explain with the help of an example each the following instructions a. STF b. RSUM c. SHIFTL d. TD e. WD Explain with the help of an example each the following instructions a. TIO b. COMP c. LPS d. SVC e. PIX Compare a 2-pass assembler with a 1-pass assembler. How forward references are handle in 1-pass assembler? Write a program to sort the given set of 10 elements in ascending order if the content of memory location Loc is ODD else sort them in descending order. Generate the machine code for the following: +JSUB RDREC,STL RETARD, LDB # LENGTH. Assume the opcode for JSUB=48H,STL=14h and LDB=68H the location counter value for RDREC =1036, RETARD=0030 LENGTH=0033. How do you specify the SIC/XE system assembly program if the displacement is greater than 12-bits? Explain the need for BASE and NOBASE directive with example. What is the difference between literal and immediate operand? How the assembler does handle literal operand? How does relocation problem solved by relative addressing mode? Explain with an example

Write a note on MASM assembler Define the following with an example: i) Operation code table ii)Symbol table Describe how the assembler handles literal operands. Give the format of the following records necessary to obtain object code: i) Define record ii) Refer record iii)Modification record(revised) What are program blocks? With a suitable example, explain how program blocks are handled by an assembler.

PESIT SOUTH CAMPUS-Education for the real world

10

8

8 10 10 10 10 10 10

10

6 6 5 5

6 6 6 10* 6*

Page 3

PESIT SOUTH CAMPUS Explain how multipass assembler handles the following forward reference.

41.

42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54.

1 2 3 4 5

HALfSZ MAXLEN PREVBT BUFFER BUFFEND

EQU EQU EQU RESB EQU

MAXLEN/2 BUFEND-BUFFER BUFFER-1 4096 *

Assume that, when assembler goes to line 4,location counter contains 1034(hex)

10*

Explain load and go assembler,with an example. Explain any one Assembler What are literals? Explain Discuss the different methods of achieving program relocation What is program relocation? Why it is to be supported by an assembler List and explain the functionalities of an assembler Explain the data structures needed in the construction of an assembler What is symbol table? explain Briefly explain the working principle of a multi pass assembler What is the need of BASE assembler directive? When it is to be used? Explain the Pass-1 algorithm of a 2 pass assembler Explain the Pass-2 algorithm of a 2 pass assembler What are assembler directives? Explain any 5 assembler directives with example

8 5 5 8 5 5 8 10 10 6 10 10 6

Chapter 3: LOADERS AND LINKERS Objective: This topic discusses how a program will be loaded in to the memory and how it is linked to other programs. 1.

What is loader? What are the basic functions the loader has to perform? What is relocation? Explain the methods for specifying relocation as a part of object 2. program. 3. Explain the working of linkage editor and linking loader. 4. With a diagram ,explain how object program can be processed using linkage editor. 5. Discuss dynamic linking with suitable examples. Write explanatory notes on 6. Boot Strap Loader 7. Write a program in SIC/XE machine for a simple bootstrap loader 8. Discuss the capabilities of inter active system and explain the debugging. 9. With the help of an example, show relocation and linking operations are performed. 10. Enlist any four different loader option commands. 11. Define the following: i) Linking Loader ii) Dynamic linking PESIT SOUTH CAMPUS-Education for the real world

4* 8* 8* 10* 10 5 10 12 12* 4* 4* Page 4

PESIT SOUTH CAMPUS 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27.

Give and explain the algorithm or source program for a simple Bootstrap loader. Distinguish between linking loader and linkage editors. Explain the dynamic linking with a suitable diagrams Explain machine dependent loader features. Explain a relocating loader. Explain the concept program linking. Write and Explain the algorithm used for the design of linking loader. Explain the data structures used for linking loader. Explain the machine independent loader features. Explain linkage editors. Write a note on dynamic linking. Explain the functions of linking loader and linkage editor, highlighting the differences Explain the structure of a typical editor with the help of a suitable diagram Explain MS-DOS linker. Explain dynamic linking with suitable diagrams. Discuss Loader and Linker option on any two systems.

28. Distinguish between linking loader and linkage editors. With the help of an example, show how relocation and linking operations are 29. performed. 30. Enlist any four different loader option commands 31. Define the following: i)Linking loader ii)Dynamic linking 32. Discuss the key functionality of a loader 33. Discuss the key functionality of a linker 34. Explain linking loaders 35. Explain linkage editors 36. Clearly differentiate between linking loaders and linkage editors 37. Explain dynamic linking 38. Explain any one type of linker 39. Explain the working principle of linking loader 40. Write a bootstrap loader

8* 4* 8* 10 10 10 10 8 8 8 8 10 12 10 8 8 10 4 12 4 4 5 5 5 5 10 6 6 6 10

Chapter 4: EDITORS AND DEBUGGING SYSTEMS OBJECTIVE: About Text Editors that is overview of Editing Process and Debugging functions. 1. 2. 3. 4. 5.

Define a text editor. With a diagram Explain a typical Editor Structure Explain the overview of editing process. Explain user interface. Explain editor structures. Define debugging systems. Explain the different tasks to be accomplished by a text editor for an interactive user 6. computer dialogue. 7. Write an algorithm for linking loader. Describe debugging functions and capabilities 8. 9. Explain the functions and capabilities of interactive debugging system

PESIT SOUTH CAMPUS-Education for the real world

8 8 8 8 10 10* 12 10 6

Page 5

PESIT SOUTH CAMPUS Discuss the data structures required in the design of linking loaders 10. Write short notes on the features of line-editor, Text Editor, graphical Editor and word Processor. List the important four tasks to be accomplished by a text editor for an interactive user 11. computer dialogue. 12. Discuss three basic types of computing environments for editors. 13. Define tracing and trace back in debugging functions. 14. Write a note on the concept of user interface criteria in a text editor 15. Explain the different computing environments for editors Explain the different tasks to be accomplished by a text editor for an interactive user 16. computer dialogue. 17. What is an interactive debugging system? Explain 18. With a neat diagram explain the workflow of an editor

8 10 4 6 4 6 6 8 6 10

Chapter 5: MACROPROCESSORS OBJECTIVE: The Objective of this chapter is to know about Macro processor functions and Definitions. dealing with the implementation of MASM macro Language. Also dealt with Macro Processor Features, like Macro Expansion, Keyword Macro Parameters. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.

21.

What is Macro? Briefly discuss various data structures required for a design of MACRO PROCESSOR Explain the concept of macro definition and macro. Explain the data structures involved in macro processor algorithms. Explain the advantages and disadvantages of general purpose macro processors Write explanatory notes on general purpose macro processors What are the data structures used in the macro processor design? Explain concatenation of macro parameters with suitable examples List the different tables used for a macro processor. Explain their functions Explain machine independent macro processor features. Explain conditional macros with an example. Explain keyword macro parameters. Explain macro processor design. Write a note on recursive macro. Explain general-purpose macro processors. Explain macro processing in compilers. Explain MASM macro processor. List and explain the different design option for a macro processor. Briefly discuss various data structure required for a design of a macro processor. Illustrate the Conditional assembly of MASM Macro Processor. Explain the functioning of General purpose Macro Processor. Write one pass macro Processor algorithm And explain. Explain with suitable examples Conditional Macro Expansion And Recursive macro Expansion. Using the following definition, expand the following macro calls, called in sequence. i). LABEL RDBUFF F2, BUFFER, LENGTH,(04,12) ii). RDBUFF OE, BUFF,RLENG, 2048 RDBUFF MACRO &INDEV,&BUFADR,&RECLTH,&EOR,&MAXLTH &EORCT SET %NITEMS(&EOR)

PESIT SOUTH CAMPUS-Education for the real world

8* 6 6* 8* 6 8 7 6* 8 8 8 8 8 8 8 8 12 6 8 6 10

8

Page 6

PESIT SOUTH CAMPUS CLEAR CLEAR IF +LDT ELSE +LDT ENDIF $LOOP TD JEQ RD &CTR SET WHILE COMP JEQ &CTR SET ENDW STCH TIXR JLT $EXIT STX MEND

X A (&MAXLTH AQ ‘ ‘) #4096 #&MAXLTH =X’&INDEV’ $LOOP =X ‘&INDEV’ 1 (&CTR LE &EORCT) =X’0000 &EOR[&CTR]’ $EXIT &CTR+1 &BUFADR, X T $LOOP &RECLTH

22. Write an algorithm for an one pass macro processor. Explain ANSI C macro language. 23.

10 5

What are functions of macro Processor? Explain the various data structures used in 24. the implementation of a 1-pass macro processor.

10

25. 26. 27. 28. 29. 30. 31. 32.

3 5 5 6 10 6 8 6

WRITE A SHORT NOTE ON “KEYWORD MACRO PARAMETERS” Explain the role of a macro processor Explain anyone macro processor Discuss the different data structures needed to construct a macro processor What is a general-purpose macro processor? Explain What are conditional macros? Explain Write a note on macro expansion Explain the advantages and disadvantages of macros

Chapter 6: LEX and YACC OBJECTIVE: The objective here is to know about the Language specifiers like Lex and Parser generator like YACC. & how to use LEX & YACC in Programming.

1.

Explain the following regular expression with examples: i)[ ] ii) { } iii) / iv) ( ) 8

8

2.

Discuss the characters that used in the meta language as part of standard ASCII character set used in UNIX operating system.

8

PESIT SOUTH CAMPUS-Education for the real world

Page 7

PESIT SOUTH CAMPUS 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28.

Write a LEX program to identify the decimal number. What is regular expression ?Briefly explain the all characters that form regular expression. What is YACC? Explain the different sections used in writing the YACC specifications. Write a YACC program to function as a calculator which performs addition, subtraction, multiplication, division and unary operations. What is shift/reduce parsing? Explain the parsing pf the input “fred= 12+13” and represent it using parse tree. Explain the ambiguity while passing 2+3 x 4. Explain the solution for it. Explain various sections of a LEX specification using a basic word count program reading from a file. Explain various sections of a LEX specification using a basic word count program by reading from a file. Define YACC tools. What are the two types of conflicts in YACC? Give examples. Write YACC program to validate a simple arithmetic expression involving operators +,-,*,/ Define and explain the use of YYwrap() With an example explain LEX. Describe the general structure of LEX program with a suitable a example. Write YACC Program to Validate a simple if statement & count them. Write a LEX program to remove uppercase letters & write spaces in a file. Explain the implementation of lexical analyzer. Write a short note on “parser-lexer communication”. Write a lex program to count the number of vowels and consonants in a given string. Expression in UNIX with proper examples. Give the LEX and YACC specifications to recognize parenthesized Arithmetic expression. Explain the use of yyleng Write a note about handwritten lexer Write a lex & yacc program to recognize an b2n Write a lex program to recognize all your classmates names Discuss how to reduce the shift-reduce conflict Explain the different characters used in the regular expressions

PESIT SOUTH CAMPUS-Education for the real world

6 10 10 10 10 10 7 7 8 8 4 4 8 12 8 8 6 6 6 8 3 5 8 5 5 10

Page 8

PESIT SOUTH CAMPUS ASSEMBLY LANGUAGE PROGRAMS 1. 2. 3. 4. 5. 6.

7. 8. 9. 10. 11.

12. 13. 14. 15. 16. 17.

Write SIC assembly level language program to clear a 20-byte string to all blanks. Write SIC/XE assembly level language program to clear a 20-byte string to all blanks. Use immediate addressing and register-to-register instruction to make the program efficient. Write a assembly language program for instructions for SIC to initialize an array of 100 elements to 0. Write an assembly language program for instructions for SIC/XE to initialize an array of 100 elements to 0. Write an assembly language program for SIC machine that will read a 100 byte record and write it into a output whose address is C0H use subroutine. Write a assembly language program for SIC/XE machine that will read 100-byte record and write it into a output whose address is C0H use Subroutine. Write an assembly language program to move a block of data bytes of length 100H from the source block starting at location 200H in DS to the destination block starting at location 3000H in ES. Assume ES and DS are already initialized. Write an assembly language program to find the largest element in an array Recursively. Write an assembly language program to compute the factorial of 8-bit Number at a byte location using recursion. Write an assembly language program to compute GCD of four16 bits Unsigned numbers and store the result in the word location GCD. Write an assembly language program to sort in ascending order using bubble sort algorithm, a given set of bytes sized unsigned numbers in memory. The sorted elements should replace the original unsorted elements in memory. Write an assembly language program to sort in ascending order using insertion sort algorithm, a given set of 16-bit unsigned numbers in memory. The sorted elements should replace the original elements in memory. Write an assembly language program to search for a given 8-bit value using linear search in an array of 8-bit numbers. Write an assembly language program to compute the LCM 16-bit unsigned integers and store the result in word location LCM. Write an assembly language program to compute nCr given n and r using recursion. Write an assembly language program to compute using co-processor, hypotenuse of a right-angled triangle, given the 2 sides as real numbers. Write an assembly language program to compute the square root of a real integer by Newton Raphson's method, using co-processor.

10 10 10 10 10 10

10 10 10 10 10

10 10 10 10 10 10

Mini Projects

1. 2. 3. 4.

Develop a simple text editor Create a assembler for the hypothetical SIC machine Develop a text editor, which supports a spell checking option. If any mistakes are found then it has to list a set of appropriate words. Create a assembler for the hypothetical SIC/XE machine PESIT SOUTH CAMPUS-Education for the real world

Page 9

PESIT SOUTH CAMPUS 5. 6. 7. 8.

Create a macro processor for C language Create a macro processor for SIC/XE language Develop a text editor, which supports a grammar checking option. If any mistakes are found then it has to specify the corrected statement Develop a Intelligent text editor which predicts the words depending on first few key hits.

PESIT SOUTH CAMPUS-Education for the real world

Page 10