Sie sind auf Seite 1von 28

SYSTEM SOFTWARE – 2 MARKS

UNIT-I
1. Define System Software.
System Software is a collection of a System programs that perform a variety of
functions, viz file editing, resource accounting, I/O management etc.

2. What are the components of System Software?


Compilers, Loader, Linker, Assembler, Operating Systems, Macro processors.

3. How many Registers are there in SIC machine?


There are 5 Registers of 24 bits in length. They are,

i. A-ACCUMULATOR
ii. X-INDEX REGISTER
iii. L-LINKAGE REGISTER
iv. PC-PROGRAM COUNTER
v. SW-STATUS WORD
4. What is instruction set?
Instruction set provides the information about the types of instructions given in
the particular architecture. Instruction set differs from architecture to architecture.

5. What is the purpose of Registers in a System?


The purpose of register is to store temporarily the intermediate results at the time
of execution. The storage capabilities of the registers are in Bytes. Without
registers no operations are carried out in a system.

6. Explain the use of Linkage Register.


Linkage Register can be used to store the return address of instructions like JSUB (JUMP ROUTINE).
7. What is Program Counter?
Program Counter contains the address of the next instruction to be fetched for execution.
8. How I/O operations are performed in SIC machine?
I/O operations on the SIC are performed by transferring 1 byte at a time to or
from the right most 8 bits of register A.
9. What is Condition Code Instruction?
The condition code is set to indicate the result of the Test Device Instruction. A
setting of ‘<’ means the device is ready to send or receive, & ‘=’ means the device
isn’t ready.

10. What is SIC?


SIC stands for Simplified Instructional Computer. SIC is a hypothetical computer
that has been designed to include hardware features most often found on real
machines avoiding unusual or irrelevant complexities.
SIC comes in two versions:
i. 1.The SIC Model
ii. 2.SIC / XE version (XE-“Extra equipment”)
iii.
11.Name the Registers found in SIC/XE.

Mnemonic Number Special use


B 3 Base register; used for addressing
S 4 General working register
T 5 General working register
F 6 Floating-point acumulator (48bits)

12.What is Virtual Address Space in VAX?


VAX programs operate 9in a virtual address space of 232 bytes. This virtual
memory allows programs to operate as though had access to an extremely large
memory regardless of memory actually present on the system.

13.What are System Space and Process Space?


One half of the VAX Virtual address Space is called System Space, and is shared
by all programs. The other half of the operating system, and is shared and is called
process Space, and is defined separately for each program.
UNIT-II

14.What is an Assembler?
An assembler is a computer program for translating assembly language —
essentially, a mnemonic representation of machine language — into object code.
15.What ia an assembler Directive?
Statement of this kind neither represent machine instructions to be included in the
object program nor indicate the allocation of storage for constants or program
variables.Instead,these statements direct the assembler to take certain action during
the process of assembling a program.
16.What are the functions of an assembler?
Converts mnemonics operation codes to their machines language equivalents.
Converts symbolic operands to their equivalent machine addresses.
Builds the machine instructions in the proper format.
Converts the data constant specified in the source program into their internal machine
representations.
Writes the object program and assembly listing.

17.What is OPTAB?
OPTAB stands for Operation Code Table.OPTAB is data structure used to look up
mnemonic codes and translate them to their machine language equivalents.
18.What is SYMTAB?
Symbol Table is a data structure to hold the symbols encountered during pass-1 and
their values.
19.What is Location Counter (LOCCTR)?
Location Counter is a variable that is used to help in the assignment of addresses.
LOCCTR is initialized to the beginning address specified in the START statement.
20.Define “Literal Pools”.
All of the literal operands used in a program are gathered into one or more literal pools.
Normally literals are placed into at the end of the program.
21.What is Load-and –Go assembler?
The Load-and –Go assemble is a one-pass assembler that generates the object code in
memory for execution. No object program is written out and no loader is needed.
22.What are the two assembler directives used to identify external reference?
Symbols that are defined in one control section may not be used directly by another
control section, they must be identified as external references for the loader to handle.
To identify such references EXTDEF and EXTDEF assembler directives are used.

23.How the JUMP instructions are assembled in a MASM?


JUMP instructions are assembled in two different ways (near jump, far jump), depending
on whether the target of the jump is in the same code segment as the jump instructions.
UNIT-III
24.What is a Loader?
A loader is a System Program that takes the object code of a program as input and
prepares it for execution.

25.List out the Functions of a Loader.


The following are the basic functions that have to be performed by a Loader.
•Loading: brings the object program into the memory for execution.
•Relocation: modifies the object program so that it can be loaded at an address
different from 0.
•Linking: combines two or more separate object programs and supplies the
information needed to allow references between them.
–Subroutines Libraries
–Linkage editors
–Dynamic Linking

In most cases all the program translators on a particular system produce object
programs in the same format.

26.What is a Relocation Bit?

“Relocation Bit” often solves the problem of relocation. The assembler associates a
bit with each instruction or address field. If this bit equals one, then the address field
must be relocated, otherwise the field is not relocated.

27.Define Bit Mask.


The Relocation bits are gathered together into a Bit Mask following the length
indicator in each Text records. This Mask is represented in character form as three
hexadecimal digits.

28.What is a Bootstrap Loader?


Bootstrap Loader is an absolute loader, which loads the first program to be run by
the computer.

29.Define Compile-and-Go Loaders.


Here, at first assembler runs the program in one part of the memory and
does the assembly process & then places the assembled instruction in the designed
memory location.

30.What is a Direct Linking Loader?


It’s a relocate loader whose input consists of a set of control sections that are to be
linked together.

31.What does Dynamic Linking mean?


Dynamic linking is a scheme that postpones the linking operation until
execution time. Here the subroutine is loaded & linked to the rest of the program
when it’s first called. Also called as Dynamic Loading or Load on call.
UNIT-IV
32.Define a Macro.

A macro represents a commonly used group of statements in the source


programming language.

33.What is the purpose ARGTAB?


When a macro invocation statement is recognized, the arguments are stored in
ARGTAB according to their position in the argument list. As the macro is expanded,
arguments from ARGTAB are substituted for the corresponding parameters in the macro
body.

34.Define Automatic Library Call.


The programmer does not need to take any action beyond mentioning the
subroutine.
Fetching, Linking, &Loading the routines are done automatically.

35.How the JUMP instructions are assembled in a MASM?


JUMP with forward reference
» Near jump: 2 or 3 bytes
» Far jump: 5 bytes
» e.g. JMP TARGET
» Warning: JMP FAR PTR TARGET
» Warning: JMP SHORT TARGET
» Pass 1: reserves 3 bytes for jump instruction

36.What are the three main data structures used by our macro-processor?
Data Structures -- Global Variables

DEFTAB
NAMTAB
ARGTAB
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>
#include<graphics.h>
#include<dos.h>
struct emp
{
char rno[10];
char tname[10];
char from[10];
char to[10];
int st;
}a;
struct emp1
{
char rno[10];
char tdate[8];
int st;
}b;

FILE *fp1,*fp2,*fp3;
char fname[20],fname1[20];
void add();
void edit();
void disp();
void dele();
void res();
void grap();
void main()
{

int ch=0,r1;
grap();
while(ch!=6)
{
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("

1.Add Train details");


printf("
2.Delete Train details");
printf("
3.Updata Train details");
printf("
4.Display List");
printf("
5.Reservation");
printf("
6.Exit");
printf("
");
printf("
Enter the choice : ");
scanf("%d",&ch);
switch(ch)
{
case 1:
add();
break;
case 2:

dele();
break;
case 3:
edit();
break;
case 4:
disp();
break;
case 5:
res();
break;
case 6:
exit(0);
}
}
}
void add()
{
char yesno='y';
clrscr();
fp1=fopen("rwl.dat","a");
// printf("ADD FILES");
while(yesno=='y'||yesno=='y')
{
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("
Enter the train Number :");
scanf("%s",a.rno);
printf("
Enter the Train name :");
scanf("%s",a.tname);
printf("
Enter the Arrival station :");
scanf("%s",a.from);
printf("
Enter the Departure station :");
scanf("%s",a.to);
printf("
Enter the Total Seats : ");
scanf("%d",&a.st);
fprintf(fp1,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,a.st);
printf("
do u want to continue[y/n]");
yesno=getchar();
fflush(stdin);
}

fclose(fp1);
}
void edit()
{
char empno1[4];
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("
Enter the train Number to edit :");
scanf("%s",empno1);
fp1=fopen("rwl.dat","r");
fp2=fopen("trwl.dat","w");
strcpy(fname,"rwl.dat");
strcpy(fname1,"trwl.dat");
while(!feof(fp1))
{
fscanf(fp1,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,&a.st);
// printf(" %s ",a.rno);
if(strcmp(a.rno,empno1)==0)
{
printf("
Enter the train Number :");
scanf("%s",a.rno);
printf("
Enter the Train Name :");
scanf("%s",a.tname);
printf("
Enter the Arrival station :");
scanf("%s",a.from);
printf("
Enter the Departure station :");
scanf("%s",a.to);
printf("
Enter the Total Seats :");
scanf("%d",&a.st);
fprintf(fp2,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,a.st);
// break;
}
else
fprintf(fp2,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,a.st);
}
fclose(fp1);
fclose(fp2);
unlink(fname);
rename(fname1,fname);

void disp()
{
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^
");
printf(" TRAIN-NO NAME DEP ARR SEATS
");
printf(" -------- ---- ---- ----- ------
");
fp1=fopen("rwl.dat","r");
while(!feof(fp1))
{
fscanf(fp1,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,&a.st);
printf(" %s %s %s %s %d
",a.rno,a.tname,a.from,a.to,a.st);
}
fclose(fp1);
getch();
}

void dele()
{
char empno1[4];int i=0;
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("
Enter the train Number to delete :");
scanf("%s",empno1);
fp1=fopen("rwl.dat","r");
fp2=fopen("trwl.dat","w");
strcpy(fname,"rwl.dat");
strcpy(fname1,"trwl.dat");
while(!feof(fp1))
{
fscanf(fp1,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,&a.st);
if(strcmp(a.rno,empno1)!=0)
{
fprintf(fp2,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,a.st);
}
else
{ i=1;
printf("
TRAIN DETAILS DELETED SUCCESSFULLY ");

}
}
if(i==0)
{
printf("
SORRY -> INVALID TRAIN NUMBER ");

}
fclose(fp1);
fclose(fp2);
unlink(fname);
rename(fname1,fname);
getch();

void res()
{
char empno1[4],tdate[8];
int i=0,n;
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("
Enter the train Number :");
scanf("%s",empno1);
printf("
Enter the Date :");
scanf("%s",tdate);
{
fp1=fopen("res.dat","r");
fp2=fopen("trwl.dat","w");
strcpy(fname,"res.dat");
strcpy(fname1,"trwl.dat");
while(!feof(fp1))
{
fscanf(fp1,"%s %s %d
",b.rno,b.tdate,&b.st);
if((strcmp(b.rno,empno1)==0) && (strcmp(b.tdate,tdate)==0))
{
i=1;
printf("
Total seats Available : ");
printf("%d",b.st);
printf("
Enter the Number of Seats:");
scanf("%d",&n);
if(n > b.st)
{
printf("
SORRY,LIMIT EXCEEDED ");
}
else
{ b.st=b.st-n;
printf("
TICKETS BOOKED SUCCESSFULLY ");
}
fprintf(fp2,"%s %s %d
",b.rno,b.tdate,b.st);
}
else
{
fprintf(fp2,"%s %s %d
",b.rno,b.tdate,b.st);
}
}
rewind(fp1);
fclose(fp1);
fclose(fp2);
// printf(" %d ",i);
// getch();
if (i==1)
{
getch();
unlink(fname);
rename(fname1,fname);
}

if (i==0)
{
fp1=fopen("rwl.dat","r");
while(!feof(fp1))
{
fscanf(fp1,"%s %s %s %s %d
",a.rno,a.tname,a.from,a.to,&a.st);
// printf("%s",a.rno);
if(strcmp(a.rno,empno1)==0)
{ i= 2;
n=a.st;
}
}
fclose(fp1);
if (i==2)
{
fp1=fopen("res.dat","a");
{
/* printf("
Enter the train Number -> ");
scanf("%s",b.rno);
printf("
Enter the Date -> ");
scanf("%s",b.tdate); */
strcpy(b.rno,empno1);
strcpy(b.tdate,tdate);
printf("
Total Seats Available : %d ",n);
printf("
Enter Number of seats : ");
scanf("%d",&b.st);
if( n < b.st)
{
printf("
SORRY,LIMIT EXCEEDED ");
b.st=n;
}
else
{b.st=n-b.st;
printf("
TICKETS BOOKED SUCCESSFULLY ");
}
fprintf(fp1,"%s %s %d
",b.rno,b.tdate,b.st);
//fflush(stdin);
}
rewind(fp1);
fclose(fp1);
getch();
}
else
{
clrscr();
printf("
SOUTHERN RAILWAYS");
printf("
^^^^^^^^^^^^^^^^^");
printf("
Enter the Valid Train Number ");
getch();
}
}
}

void grap()
{
int gdriver = EGA, gmode = EGAHI;
int bkcol, maxcolor, x, y,i;
char msg[80];

/* initialize graphics and local variables */


initgraph(&gdriver, &gmode, "");

//' settextstyle(3,0,12);
// outtextxy(200,20,"RMD");

for (i=1;i<=70;i++)
{
setcolor(7);
circle(i,20+i,i);
circle(i,220-i,i);
circle(620-i,220-i,i);
circle(620-i,20+i,i);
delay(100);

settextstyle(3,0,12);
outtextxy(200,20,"RMD");
settextstyle(3,0,4);
outtextxy(155,160,"ENGINEERNG COLLEGE");
delay(3000);
for (i=1;i<=90;i++)
{
setcolor(1);
line(155,60+i,470,60+i);
line(155,200-i,470,200-i);
delay(20);
setcolor(0);
line(155,60+i,470,60+i);
line(155,200-i,470,200-i);

}
for (i=1;i<=270;i++)
{
setcolor(1);
line(312-i,10,312-i,250);
line(309+i,10,309+i,250);
delay(10);
setcolor(0);
line(312-i,10,312-i,250);
line(309+i,10,309+i,250);

}
setcolor(15);
settextstyle(3,0,4);
outtextxy(200,100,"WELCOME TO");
settextstyle(3,0,4);
outtextxy(90,150,"RAILWAY TICKET RESERVATION");
delay(1000);
getch();
closegraph();
}

BLINKING STRARS
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<dos.h>
void main()
{
int gdriver=DETECT,gmode;
int i,x,y;
initgraph(&gdriver,&gmode,"e: cgi");
Mnemonic Number Special use
while(!kbhit())
B Base register; used for addressing
3
{ S 4 General working register
T 5 General working register
x=random(640);
F 6 Floating-point acumulator (48bits)
y=random(480);
setcolor(15);
for(i=1;i<10;i++)
{
circle(x,y,i);
delay(10);
}
setfillstyle(1,15);
line(x+8,y-2,x+40,y);
line(x+8,y+2,x+40,y);
floodfill(x+11,y,15);
line(x-8,y-2,x-40,y);
line(x-8,y+2,x-40,y);
floodfill(x-11,y,15);
line(x-2,y+8,x,y+40);
line(x+2,y+8,x,y+40);
floodfill(x,y+11,15);
line(x-2,y-8,x,y-40);
line(x+2,y-8,x,y-40);
floodfill(x,y-11,15);
line(x+8,y-2,x+20,y-20);
line(x+2,y-8,x+20,y-20);
floodfill(x+15,y-15,15);
line(x+8,y+2,x+20,y+20);
line(x+2,y+8,x+20,y+20);
floodfill(x+15,y+15,15);
line(x-8,y+2,x-20,y+20);
line(x-2,y+8,x-20,y+20);
floodfill(x-15,y+15,15);
line(x-8,y-2,x-20,y-20);
line(x-2,y-8,x-20,y-20);
floodfill(x-15,y-15,15);
sound(4000);
setcolor(0);
for(i=40;i>=10;i--)
{
line(x+8,y-2,x+i,y);
line(x+8,y+2,x+i,y);
}
for(i=40;i>=10;i--)
{
line(x-8,y-2,x-i,y);
line(x-8,y+2,x-i,y);
}
for(i=40;i>=10;i--)
{
line(x-2,y+8,x,y+i);
line(x+2,y+8,x,y+i);
}
for(i=40;i>=10;i--)
{
line(x-2,y-8,x,y-i);
line(x+2,y-8,x,y-i);
}
for(i=20;i>=7;i--)
{
line(x+8,y-2,x+i,y-i);
line(x+2,y-8,x+i,y-i);
}
for(i=20;i>=7;i--)
{
line(x+8,y+2,x+i,y+i);
line(x+2,y+8,x+i,y+i);
}
for(i=20;i>=7;i--)
{
line(x-8,y+2,x-i,y+i);
line(x-2,y+8,x-i,y+i);
}
for(i=20;i>=7;i--)
{
line(x-8,y-2,x-i,y-i);
line(x-2,y-8,x-i,y-i);
}
for(i=9;i>0;i--)
{
circle(x,y,i);
delay(10);
}
nosound();
}
cleardevice();
setcolor(2);
settextstyle(2,0,1);
outtextxy(220,160,"Creator:Shasankar Paul");
outtextxy(265,235,"Bsc Ist Year");
outtextxy(210,335,"Email:shash1986@dataone.in");
getch();getch();
}

Program for counting number of Parity Bits in an integer.

main()
{
int num, cnt = 0;

printf("enter the no :");


scanf("%d",&num);

while (num != 0)
{
num = num & (num - 1);
cnt++;
}
printf("
number of parity bits = %d ",cnt);
}

Das könnte Ihnen auch gefallen