Short Questions and Answers

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Short Questions and Answers

UNIT-1

1. Define system software:


System software consist of a variety of programs that support the operation of a
computer. This software makes it possible for the user to focus on the application or other
problem to be solved without needing to know the details of how the machine works internally.

2. What is the purpose of test device instruction?


The test device (TD) instruction tests whether the addressed device is ready to send or
receive a byte of data.

3. What is meant by index addressing?


The index addressing can be calculated by the formula

Effective address (EA)=1000+ [X]


=1000+ content of the index register X

For eg:
STCH BUFFER,X

0101 1100 1 001 0000 0000 0000

5 4 1 0 0 0
Opcode x BUFFER

4. Following is a memory configuration:


Address value Register R

1 5 5
5 7
6 5
7 7
What is the result of the above?
ADD 6 (immediate) to R (indirect)
result:
6+7=13

5. How are floating point value represented using exponent in SIC/XE?


The exponent has value e and the fraction has value f, the absolute value of the number
represented is
f*2^(e-1024)
The sign of the floating point number is indicated by the value of s.

6. Explain the use of SVC instruction in SIC/XE?


SVC->supervisor call instruction.
Executing SVC instruction generates an interrupt that can be used for communication
with the operating system.

7. What are the additional registers in SIC/XE?

Mnemonic Number Special use

B 3 Base register; used for addressing

S 4 General working register-no special use

T 5 General working register-no special use

F 6 Floating-point accumulator(48 bits)

8. Following is a memory configuration


Address value Register R

1 6 A
5 6
6 B
7 8
What is the result of the following statement
ADD 6 (immediate) to R (indirect)
result:
6+B=17(decimal)=11(hexa decimal)

9. Illustrate how the input and output operations are performed in SIC.
Input and output are preformed by transferring 1 byte at a time to or from the rightmost
8 bits of register A.Each device is assigned a unique 8 -bit code.
* The test device (TD) instruction test whether the addressed device is ready to send or receive a
byte of data.
*A program to transfer data must wait unit the device is ready, then execute read data (RD) or
writ data (WD).

10. What is the data format used in the SIC system?


Integers are stored as 24-bit binary number; 2’s complement representation is used for
negative values. Characters are stored using their *-bit ASCII codes. There is no floating point
hardware on the standard version of SIC.

11. Distinguish between direct and indexed addressing.


Mode Indication Target address calculation Example
Direct X=0 TA = address LDA TEN
Indexed X=1 TA = address + (x) BUFFER,X
(x)->contents of register x.

12. What are the different registers used in SIC?


Registers:A(Accumlator)
I – Indexed register
L – Linkage register
PC – Program counter
SW – status word

13. What is base relative addressing?


For base relative addressing, the displacement filed disp in a format 3 instruction is
interpreted as a 12-bit unsigned integer . Target address is calculated by adding displacement
with content of base register.
Base relative: b=1,p=0
Target address ( TA)=( B) +disp (0<disp< 4095)
( B) - content register B

14. What is meant by application software?


An application software is primarily concerned with the solution of some problem, using
computer as a tool. “The focus is on the application not on the computing system.

15. Define system program:


A system program is a program which aides in effective execution of a general use
computational requirements on a computer system.

16. Give the examples of system software:


Assembler, compiler, loader, linker, microprocessor, text editor, debugger.

17. What is operating system?


It is the main example of system software which consist of a set of system software.

18. What is instruction?


Instruction is a command to a microprocessor which initiates some internal and external
operations.

19. Define instruction set?


A set of all instructions for a particular processor is called instruction set for that
processor.

20. Define assembly language?


Instructions are supplied to a processor in binary form. A program in this form is called
machine language program. For human understanding each machine instruction is coded into
English. This type of mnemonic coding is called assembly coding. A program in which
instructions are in assembly coding is called assembly language program.

21. What is assembler?


Assembler is a software which converts assembly language program into machine
language program.

22. What is compiler?


Compiler is a system software which converts high level language program into machine
language program.

23. Define linker?


Linker links the subprograms or procedures of an object file, if a file sum.obj is input for
linker then the output file will be sum.exe.
24. Define loader?
Loader is a part of an operating system which loads the exe module from secondary
memory into main memory and transfers the control of execution to the starting of exe program.

25. What is I/O program?


I/O programs are system software, part of BIOS or DOS which is responsible for transfer
of input and output data.

26. Define macro processor:


If part of a program is repeated many times then a common coding can be used. The
macro name and macro definition are defined.

27. Define memory:


Memory is the device where the information is stored.

28. Define address:


Memory locations are specified by addresses, where each address identify a specific
type, word or character.

29. Define processor:


Processor is the device that performs a sequence of operations specified by instructions in
memory.

30. What is meant by location counter?


Location counter is also called as program counter(PC) or instruction counter(IC) is a
hardware memory device which denotes the location of the current instruction being executed.

31. What is meant by instruction register?


A copy of the current instruction is stored in the instruction register.

32. What is meant by instruction interpreter?


The instruction interpreter is a group of electrical circuits(hardware) that performs the
intent of instruction fetched from memory.

33. What is meant by working register?


The working registers are the memory devices that serves scratch pads for the
instruction interpreter.

34. What is meant by general register?


The general registers are used by the programmer as storage locations and for special
functions.

35. What is meant by MAR?


MAR contains the address of the memory locations i.e to be read from or stored in to.

36. What is meant by MBR?


MBR contains the copy of the designated memory locations specified by MAR after a
read or write.

37. What are the assembler functions?


(i). Translating source/assembly/mnemonics to object code
(ii). Assigns machine address to each label or symbol.

38. Define upward compatibility?


Upward compatibility means an object program for the standard SIC machine will also
execute properly on a SIC/XE system. Such upward compatibility is often found on real
computers that are closely related to one another.

UNIT – II [ASSEMBLERS]

1. What is the data structure used to organize the SYMTAB and OPCODE table in a
simple assembler? Why it is preferred?
OPTAB is used to look up mnemonic operation codes and translate them to their
machine language equivalents.
SYMTAB is used to store values (addresses) assigned to labels.

2. Consider the following sequence


X EQU Y
Y EQU Z
Z RESW 1
In a 2-pass assembler can resolve such a sequence of definition. Justify your answer.
No. The symbol Y cannot be assigned a value when it is encountered during the first pass
because Z has not yet been defined. As a result, X 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.

3. What is SYMTAB? How it is useful?


The Symbol table (SYMTAB) includes the name and value (addresses) for each label
in the source program, together with flags to indicate error conditions.
SYMTAB is usually organized as a hash table for efficiency of insertion and
retrieval.

4. List out the machine independent assembler features


The machine independent assembler features are
1. Literals
2. Symbol defining statements
3. Expressions
4. Program blocks
5. Control Sections and Program Linking.

5. What is the need for an assembler directive?


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.

Examples: 1. BYTE and WORD  direct the assembler to generate constants as part of the
object program.
2. RESB and RESW  instruct the assembler to reserve memory locations without
generating data values.
3. START  specifies the starting memory address for the object program.
4. END  marks the end of the program.

6. What is the use of location counter?


LOCCTR is initialized to the beginning address specified in the START statement. After
each source statement is processed, the length of the assembled instruction or data area to be
generated is added to LOCCTR. Thus whenever we reach a label in the source program, the
current value of LOCCTR gives the address to be associated with that label.

7. What does an assembler perform when it encounters LTORG assembler directive.


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).
This literal pool is placed in the object program at the location where the LTORG directive was
encountered.

8. Write down the pass numbers either (Pass 1 or Pass 2) of the following activities that
occur in a 2-pass assembler.
i) object code generation -
ii) Literals added to literal table -
iii) Printing assembly listing -
iv) address resolution of local symbols -

9. List the types of assembler


1. one pass assembler
2. two pass assembler
3. multipass assembler.

10. How can the assembler overcome the problem of forward reference?
The assembler overcome the problem of forward reference through two pass and
multipass assemblers.
The first pass does little more than scan the source program for label definitions an
assign addresses. The second pass performs most of the actual translation previously
described.

11. Write the uses of program relocation


1. Sharing the memory location for the different programs.
2. Avoid the wastage of processing or execution time.
3. Reduce the wastage of memory space.

12. How are jump instructions assembled?


Jump instructions are assembled in two different ways, depending on whether the target
of the jump is in the same code segment as the jump instruction. A near jump is a jump to a
target in the same code segment. A far jump is a jump to a target in a different code segment.
13. What are the functions required to translate source program to object code?
It requires the following functions
1. Convert mnemonic operation codes to their machine language equivalents.
2. Convert symbolic operands to their equivalent machine addresses.
3. Build the machine instructions in the proper format.
4. Convert the data constants specified in the source program into their internal machine
representations.
5. Write the object program and the assembly listing.

14. What is forward reference?


A reference to a label (RETADR) that is defined later in the program is called forward
reference.

15. What is object program?


The object program is a program written with the generated object codes for an assembly
language program.

16. What are the records used to write an object program?


There are three types of records
1. Header record
2. Text record and
3. End record.

17. What are the functions performed by pass 1 of two pass assembler?
1. Assign addresses to all statements in the program.
2. Save the values (addresses) assign to all labels for use in pass-2.

18. List out various machine dependent features.


1. Instruction formats and addressing modes
2. Program Relocation

19. How can you solve the relocation problem?


1. When the assembler generates the object code for the JSUB instruction are
considering, it will insert the address of RDREC relative to the start of the program.
2. The assembler will also produce a command for the loader, instructing it to add the
beginning address of the program to the address field in the JSUB instruction at load
time.

20. What is Modification Record?


Modification Record:
Col.1 M
Col.2-7 Starting location of the address field to be modified, relative to the
beginning of the program.
Col.8-9 Length of the address field to be modified, in half-bytes
(hexadecimal).
21. What is a literal?
It is often convenient for the programmer to be able to write the value of a constant
operand as a part of the instruction that uses it. This avoids having to define the constant
elsewhere in the program and makeup a label for it. Such an operand is called a literal because
the value is stated “literally” in the instruction.

22. What is literal table and literal pool?


For each literal used, literal table contains the literal name, the operand value and length,
and the address assigned to the operand when it is placed in the literal pool. All of the literal
operands used in a program are gathered together into one or more literal pools.

23. Compare absolute expression and relative expression

Absolute Relative

An expression with only absolute A relative expression is one in which


terms is called absolute expressions. all of the relative terms except one
It may also contain relative terms can be paired, the remaining unpaired
provided the relative terms occur in relative term must have a positive
pairs and the terms in such pair have sign.
opposite sides.

24. What are the advantages of MASM Assembler?


The object program from MASM may be in several different formats, to allow easy and
efficient execution of the program in a variety of operating environments. MASM can also
produce an instruction timing listing that shows the number of clock cycles required to execute
each machine instruction.
25. How the register-to-memory instructions are assembled.
The register-to-memory instructions are assembled using either program counter relative
or base relative addressing. The assembler must, in either case, calculate a displacement to be
assembled as part of the object instruction.

26. Why relative addressing is not possible with external references?


Consider the example instruction,
15 0003 CLOOP +JSUB RDREC 4B100000
The operand RDREC is named in the EXTREF statement for the control section, so this is an
external reference. The assembler has no idea where the control section containing RDREC will
be loaded, so it cannot assemble the address for this instruction. Instead, the assembler inserts an
address of zero and passes information to the loader. The address of RDREC will have no
predictable relationship to anything in this control section; therefore relative addressing is not
possible.

Average
0
Your rating: None
• Login or register to post comments
Login
Top of Form

Username (required)

Password (required)
Log in

• Create new account


• Request new password
form-cf52031397 user_login_block

Bottom of Form

Navigate

Ask!

Campus Classle Demo

Volunteer

Learning Circles

Create a Content

Kyyil

Make a Wish!
Getting Started

Login Now

You might also like