affiliate marketing

Saturday, 17 December 2011

PASS2_OF_2_PASS_ASSEMBLER


IMPLEMENTATION OF PASS-2 OF 2-PASS ASSEMBLER
AIM
To write a C-program to implement pass-2  assembler.
ALGORITHM
1.Read first line from the intermediate file.
2.Check to see if the opcode from the first line read is “START”.If so then write label,opcode and operand field values of corresponding statement directly to final output files.
3.Start the following processing for other lines in intermediate file if it is not a comment line until an “END” statement is reached.
4.Start writing labels LOCCTR opcode and operand fields of corresponding statements to the output file along with the object code.The object code is found by assembling each statement opcode machine equivalent with the label address.
5.If there is no symbol or label in the operand field , then the operand address is assigned as zero and it is assembled with object code of instruction.
6.If OPCODE is BYTE,WORD,RESB etc are convert constants to object code close operand file and exit.

PROGRAM:
#include<stdio.h>

PASS1_OF_2_PASS_ASSEMBLER


IMPLEMENTATION OF PASS-1 OF TWO PASS ASSEMBLER
AIM
To write a C-program to implement pass-1 assembler ie object code.
ALGORITHM
1.Read first line from the input file.
2.Check to see if the opcode from the first line read is “START”.If so then write label opcode and            operand field values of corresponding statement directly to find output files.
3.Start the following processing for other lines in input file if it is not a comment line until an “END” statement is reached.
4.Start writing label LOCCTR opcode and operand fields of corresponding statement to the output file along with object code.The object code is found by assembling each statement opcode machine equivalent with label address.
5.If there is no symbol or label in the operand field,then the operand address is assigned as zero and it is assembled with object code of instruction.
6.Ip OPCODE is BYTE,WORD,RESB etc are convert constants to object code.close operand file and exit.

PROGRAM:
#include<stdio.h>

SYMBOL TABLE


SYMBOL TABLE
AIM
To write a program in C to implement symbol table.
ALGORITHM
1.Create a structure having member variable and values
2.Display the option and get choice from the user
3.I f choice 1 call create()
4.If choice 2 call insert()
5.If choice 3 call modify()
6.If choice 4 call search()
7.If choice 5 call display()
8.Exit
9.create()
                Do till less than 3
                Get input from the user for variables and values
10.insert()
                Get number of records to insert.
                a.Do till i is less than sum of I and number of records to insert.
                b.Get input for symbol name and value
11.modify()
                Get record or symbol name to modify
                If it is equal to  any symbol name then print “record found”
                Else print “record not found”
                Get the value for corresponding symbol name
12.search()
                Get the symbol name to modify
If it is present in table then print “record found”
Else print “record not found”
Get the value for corresponding symbol name
13.display()
                Do till k is less than tottal number of records.
                Print the symbil name and values.

Distributed Computing University questions 2011


Answer ALL questions.
1. What are the disadvantages of distributed systems?
2. Differentiate between tightly coupled and loosely coupled systems.
3. What is predicate addressing?
4. What do you mean by server crashes and client crashes?
5. What is Synchronization?
6. Explain remote access model.
7. Discuss Fault Tolerance Issues.
8. Write a note on Concurrency Control.
9. What is a query in Distributed DBMS? Explain.
10. What is call by reference? Give an example.
PART B — (4 ? 10 = 40 marks)

Wednesday, 14 December 2011

PCD lab exercise

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
int ret[100];
static int pos=0;
static int sc=0;

void nfa(int st,int p,char *s)
 {
  int i,sp,fs[15],fsc=0;
  sp=st;
  pos=p;
  sc=st;