
Project: Compiler for a MiniC 385
the code generator and the assembly language built-in library. We shall demonstrate the use of gdb
by a small example.
12.10.1 An Example miniC Program
A small example program is as follows:
float: a,b
a = 1.1111
b = -2.0
printr(a * b)
end
This program, though simple, checks several aspects of miniC:
c
Type declaration and type setting of the variables.
c
Ability to handle variable list in declarations.
c
Memory locations assignment to variables.
c
Detection and conversion of floating-point numbers (in contrast to integers).
c
Checking unary-minus operation.
c
Working of assignment statement.
c
Checking arithmetic expression ...