Untitled
unknown
plain_text
2 years ago
749 B
6
Indexable
#include <stdio.h>
#include <stdio.h>
#include<conio.h>
#include <string.h>
void main() {
char Icode[10][30], str[20], opr[10];
int i=0;
clrscr();
printf("In Enter the set of intermediate code (terminated by exit):\n"); do
scanf("%s", icode[i]);
} while (strcmp(icode[i++], "exit") != 0);
printf("In target code generation"); printf("In*** *************); 1=0;
do {
strcpy(str, icode[i]); switch (str[3]) {
case '+':
strcpy(opr, "ADD");
break; case '-':
strcpy(opr, "SUB ");
break; case":
strcpy(opr, "MUL");
break;
case 'T':
strcpy(opr, "DIV");
break;
}
printf("InitMov %c,R%d", str[2], 1); printf("Init6s96c,R%d", opr, str[4], 1); printf("InitMov R9%d, %c", I, str[0]); } while (strcmp(icode[++i], "exit") != 0);
getch():Editor is loading...