Compiler Construction Lab Manual / If Statement Code Generationusing Lex Program

Program Name

Write a Compiler Construction Program for If Statement Code Generationusing Lex Program.
Theory

If Statement Code Generationusing Lex Program
Program Code


Saving: vi ab.c

Compiling and Running
cc ab.c
./a.out
Input
Enter the c statement if(a< b ) a=a+b Output MOV a,A MOV b,R1 CMP R2 JGE NEXT ADD b < STORE A,R1 NEXT:


Home     Back