SYSTEM SOFTWARE

INTERNAL TEST I – ANSWER KEY

Part-A

  1. Differentiate system software from application software.

system software / application software
Systems Software consists of a set of programs that support the operation of a computer system and help, the programmer, to simplify the programming process and run application software efficiently. / Applicationsoftware is all the computer software that causes a computer to perform useful tasks (compare with computer viruses) beyond the running of the computer itself.
Example:
Text editors, Compilers, Loaders, Linker, Debugger, Assembler & Operating system / Example:
MS-Office, Games, Photoshop
  1. Give any two differences between base relative addressing and program counter addressing.

Base relative addressing / Program counter addressing
For base relative addressing, the displacement field disp in a Format 3 instruction is interpreted as a 12 bit unsigned integer. / For this addressing, the displacement field disp in a Format 3 instruction is interpreted as a 12 bit signed integer, with negative values represented in 2’s complement notation.
The target address is calculated as TA= [B] + disp. / The target address is calculated as TA= [PC] + disp.
The flag bit b=1, and p=0 / The flag bit b=0, and p=1
  1. Distinguish between assembler and interpreter

assembler / interpreter
Assembler which converts assembly language programs into object files. Object files contain a combination of machine instructions, data, and information needed to place instructions properly in memory. / Interpreter is a set of programs which converts high level language program to
machine language program line by line.
  1. What is the difference between the instruction LDA #3 and LDA THREE?

In the first instruction immediate addressing is used. Here the value 3 is directly loaded into the accumulator register. In the second instruction the memory reference is used. Here the address (address assigned for the symbol THREE) is loaded into the accumulator register.

  1. What is the use of the variable LOCCTR (location counter) in assembler?

This is a variable that is used to help in the assignment of address.

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 LOCCRT.

When a label is reached, the current value of LOCCTR gives the address to be associated with that label.

Part B

  1. (a). (i) Write and explain the sequence of code in SIC and SIC/XE to read 200 byte record from the device ‘F1’ using subroutine. (10)

SIC Program

JSUBREADCALL READ SUBROUTINE

READ LDXZEROINITIALIZE INDEX REGISTER TO 0

RLOOP TDINDEVTEST INPUT DEVICE

JEQRLOOPLOOP IF DEVICE IS BUSY

RDINDEVREAD ONE BYTE INTO REGISTER A

STCHRECORD,XSTORE DATA BYTE INTO RECORD

TIXK100ADD 1 TO INDEX AND COMPARE TO 100

JLTRLOOPLOOP IF INDEX IS LESS THAN 100

RSUB

INDEV BYTEX’F1’INPUT DEVICE NUMBER

RECORD RESB100100 BYTE BUFFER FOR I/P RECORD

ZERO WORD 0

K100 WORD 100

SIC/XE Program

JSUBREADCALL READ SUBROUTINE

READ LDX#0INITIALIZE INDEX REGISTER TO 0

LDT#100INITIALIZE REGISTER T TO 100

RLOOP TDINDEVTEST INPUT DEVICE

JEQRLOOPLOOP IF DEVICE IS BUSY

RDINDEVREAD ONE BYTE INTO REGISTER A

STCHRECORD,XSTORE DATA BYTE INTO RECORD

TIXRT ADD 1 TO INDEX AND COMPARE TO 100

JLTRLOOPLOOP IF INDEX IS LESS THAN 100

RSUB

INDEV BYTEX’F1’INPUT DEVICE NUMBER

RECORD RESB100100 BYTE BUFFER FOR I/P RECORD

(ii) Write a sequence of code in SIC to implement the following expression.(6)

BETA<- ALPHA + INCR-1

DELTA<- GAMMA+INCE-1

SIC Program

(b) Compare SIC and SIC/XE architectures with respect to memory, Instruction formats, addressing modes and data formats. (16)

SIC / SIC/XE
Memory
  • Memory consists of 8-bit bytes; any 3 consecutive bytes form a word (24 bits).
  • All addresses on SIC are byte addresses; There are a total of 32,768 (215) bytes in SIC memory.
/ Memory
  • Memory consists of 8 bit.Three consecutive byte form a word.
  • All address on SIC/XE is byte address.
  • The maximum memory available on SIC/XE is one mega bite (2 20) byte.

Instruction formats
/ Instruction formats
Format 1: (1 byte)

Format 2: (2 byte)

Format 3: (3 byte)

Format 4: (4 byte)

Data formats
  • Integers are stored as 24 bit binary number.
  • 2‟s Complement representations are used for negative values.
  • Characters are stored as 8 bit ASCII Code.
  • There is no floating point hardware.
/ Data formats
  • Integers are stored as 24 bit binary number.
  • 2‟s Complement representation is used for negative value.
  • Characters are stored as ASCII code.
  • There is a 48 floating point data types

Addressing modes
Two different addressing modes are used (direct and indexed) / Addressing modes
Six addressing modes are used (base relative, program counter, direct, immediate, indirect and, simple)
  1. (a). (i) How an assembler calculates displacement for PC relative and Base relative addressing modes? (10)

Write about

  • Machine dependent assembler features
  • Instruction Format and Addressing Modes
  • Program Relocation
  • Calculate Displacement for PC Relative addressing
  • Displacement = Target address – Program Counter
  • Example
  • Calculate Displacement for Base Relative addressing
  • Displacement = Target address – Base address
  • Example

(ii) Describe the data structures used by an assembler.(6)

Write about

  • SYMTAB (Symbol Table)
  • OPTAB (Opcode Table)
  • LOCCTR (Location Counter)

(b) Define the basic functions of assembler and explain in detail the two-pass assembler algorithm with an example. (16)

Write about

  • Assembler Definition
  • Assembler Function
  • Assembler directives
  • Two Pass Assemblers
  • Algorithm of Pass1 of Two Pass assembler
  • Example
  • Algorithm of Pass2 of Two Pass assembler
  • Example
  1. Discuss the basic functions of SIC assembler and write the general format of object program. (8)

Write about

  • Functions of SIC assembler
  • General format of object program
  • Format of Header Record
  • Format of Text Record
  • Format of End Record
  • Example object program

1