Skip to main content

Posts

Showing posts from March, 2018

MACRO DATABASE

Great to know that you are curious about the databases used in the MACRO Pass1 and Pass2. Here we Go.!!!!! Pass 1: Databases Source Program Output of Source Program to be fed to Pass 2 Macro Definition Table (MDT)- Stores Macro Definitions Macro Name Table(MNT) - Stores the Macro Name that are defined in the Program Macro Definition Table Counter (MDTC) - Indicates next available entry in MDT Macro Name Table Counter (MNTC) - Indicates next available entry in MNT Argument List Array (ALA)-  Stores the index markers for dummy arguments Pass 2: Databases Input Source Program Expanded Source Code i.e  Output for Assembler  Macro Definition Table (MDT)- Created and Maintained by Pass 1 Macro Name Table(MNT) -  Created and Maintained by Pass 1  Macro Definition Table Pointer (MDTP) - Indicate next line used in Expansion. Arguments List Arrays (ALA)- Substitutes arguments for index markers. Example       ...

Write a program to get student information of 5 students using structure.

You are encouraged to post the screenshot of output in comment section. Students information in the form of Roll No, Name, Marks. You can modify the code as per the problem statement.  #include<stdio.h> #include<conio.h> struct students { int rollno; char name[15]; int marks; }s[5]; int main() {  int i;  clrscr();  printf("Enter Student information\n");  for(i=0;i<5;i++)  {   printf("Enter Roll No:\n");   scanf("%d",&s[i].rollno);   printf("Enter name\n");   scanf("%s",&s[i].name);   printf("Enter Marks:\n");   scanf("%d",&s[i].marks); }  printf("Student information is \n");  for(i=0;i<5;i++)  {   printf("\n==================\n");   printf("%d",s[i].rollno);   printf("\n------------------\n");   printf("%s",s[i].name);   printf("\n------------------\n");   printf("%d",s[i].marks); ...

First and Follow

You are encouraged to post screenshots of output in comment section. #include<stdio.h> #include<ctype.h> char a[8][8]; struct firTab {     int n;     char firT[5]; }; struct folTab {     int n;     char folT[5]; }; struct folTab follow[5]; struct firTab first[5]; int col; void findFirst(char,char); void findFollow(char,char); void folTabOperation(char,char); void firTabOperation(char,char); void main() {     int i,j,c=0,cnt=0,n;     char ip;     char b[8];     printf("\nFIRST AND FOLLOW SET \n\nenter number of productions (in format A->B+T)\n");     scanf("%d",&n);     printf("enter the productions \n");     for(i=0;i<n;i++)     {     scanf("%s",&a[i]);      }     fo...

First Pass of an Assembler

Here is the code for First Pass of an Assembler. You are encouraged to post the screenshot of the output in comment section. #include<stdio.h> #include<string.h> int main (void) { char name[8][8],value[8][4]; inti,j,l,len,k=0,val=-4,m=0; char l1[8][6],l4[8][6]; int l2[8],l3[8]; char c1[8][6]={{"ABCD"},{"NULL"},{"NULL"},{"NULL"},{"NULL"},{"FOUR"},{"TEMP"},{"NULL"}}; char c2[8][6]={{"START"},{"USING"},{"L"},{"A"},{"ST"},{"DC"},{"DC"},{"END"}}; char c3[8][6]={{"0"},{"*"},{"1"},{"1"},{"1"},{"F4"},{"1F"},{"NULL"}}; char c4[8][6]={{"NULL"},{"15"},{"FOUR"},{"=F5"},{"TEMP"},{"NULL"},{"NULL"},{"NULL"}}; char mot[8][8]={"L",...