Hot Student Stories
top-5-grammar-and-spelling-checkers-to-rock-in-2019

Program for pass1 of two pass assembler?

Kevin Sutter

in Studying

follow
followin
1 answer
0 views

1 answer


Mindee Nelson on January 3, 2019

include #include #include struct symbol { char sn[35]; int add; }s[35]; void main() { int symerr=0,oper=0,i=1,j=1,cl,k,sa,p1,f,op,l,p,d,x=1; char opcode[50],lb[25],operand[25]; char optab[10][10]={"LDA","LDB","STA","ADD","COMP","J","JEQ","SUB","STA"}; char value[10][10]={"00","b8","0c","18","28","3C","30","lc","14","78"}; FILE *fp1,*fp2; clrscr(); fp1=fopen("input1.txt","r"); fp2=fopen("inter.txt","w"); fscanf(fp1,"%s %s",&lb,&opcode); if(strcmp(opcode,"START")0) { fscanf(fp1,"%d",&lc); sa=lc; fprintf(fp2,"%d\t %s\t %s\t %d\n",lc,lb,operation code,lc); fscanf(fp1,"%s %s",&lb,&opcode); } while(!feof(fp1)) { d=lc; if(strcmp(".",lb)!=0) { if(strcmp("-",lb)!=0) { for(i=1;i


Add you answer