Professional Documents
Culture Documents
BC0051
BC0051
VELMURUGAN C
______________________________________________________________
Registration No.
531210112
______________________________________________________________
Learning Center
2527
______________________________________________________________
Course/Program
BCA
______________________________________________________________
Semester
IV Semester
______________________________________________________________
Subject Code
BC0051
______________________________________________________________
Subject Title
SYSTEM SOFTWARE
______________________________________________________________
Date of Submission
26.02.2014
______________________________________________________________
Marks Awarded
:
______________________________________________________________
_________________________________________________
_______________________________________________
Signature of Evaluator
SMU
_________________________________________
Local Optimization
Loop Optimization
CODE GENERATION:
In computer science, code generation is the process by which a compiler's
code generator converts some intermediate representation of source code
into a form (e.g., machine code) that can be readily executed by a
machine. Sophisticated compilers typically perform multiple passes over
various intermediate forms. This multi-stage process is used because
many algorithms for code optimization are easier to apply one at a time,
BOOTSTRAP LOADING:
In modern computers, the first program the computer runs after a
hardware reset invariably is stored in a ROM known as bootstrap ROM. as
in "pulling one's self up by the bootstraps." When the CPU is powered on
or reset, it sets its registers to a known state. On x86 systems, for
example, the reset sequence jumps to the address 16 bytes below the top
of the system's address space. The bootstrap ROM occupies the top 64K of
the address space and ROM code then starts up the computer. On IBMcompatible x86 systems, the boot ROM code reads the first block of the
floppy disk into memory, or if that fails the first block of the first hard disk,
into memory location zero and jumps to location zero. The program in
block zero in turn loads a slightly larger operating system boot program
from a known place on the disk into memory, and jumps to that program
which in turn loads in the operating system and starts it.
SOFTWARE BOOTSTRAPPING:
Bootstrapping can also refer to the development of successively more
complex, faster programming environments. The simplest environment
will be, perhaps, a very basic text editor (e.g. ed) and an assembler
program. Using these tools, one can write a more complex text editor, and
a simple compiler for a higher-level language and so on, until one can
have a graphical IDE and an extremely high-level programming language.
COMPILER BOOTSTRAPPING:
In compiler design, a bootstrap or bootstrapping compiler is a compiler
that is written in the target language, or a subset of the language, that it
compiles. Examples include gcc, GHC, OCaml, BASIC, PL/I and more
recently the Mono C# compiler.
typically done by the linker at link time, it can also be done at execution
time by a relocating loader, or by the running program itself.
In computer science, relocation is the process of replacing symbolic
references or names of libraries with actual usable addresses in memory
before running a program. It is typically done by the linker during
compilation, although it can be done at run-time by a loader. Compilers or
assemblers typically generate the executable with zero as the lower-most,
starting address. Before the execution of object code, these addresses
should be adjusted so that they denote the correct runtime addresses.
In the fig. 7.6 the reference count is one. If the reference count reaches to
0 (zero), the Garbage collector removes the object from memory and
allocates the freed space to another program or object (see fig. 7.7.)
Remember, GC is part of the java environment.
MEMORY LEAK:
In computer science, a memory leak is a particular kind of unintentional
memory consumption by a computer program where the program fails to
release memory when no longer needed.
Question 6: What is the role of compilers in Error Detection and
Recovery?
Ans.:
To be useful, a compiler should detect all errors in the source code and
report them to the user.
These errors could be:
Lexical errors: e.g., badly formed identifiers or constants, symbols which
are not part of the language, badly formed comments, etc.
Syntactic errors: chains of syntactic units that do not conform to the
syntax of the source language.
Semantic errors: e.g., operations conducted on incompatible types,
undeclared variables, double declaration of variable, reference before
assignment, etc.
Run-time errors: errors detectable solely at run time, pointers with null
value or whose value is outside allowed limits, or indexing of vectors with
unsuitable indices, etc.
A good compiler
Reports ALL errors
Does not falsely report errors.
Does not repeatly report the same error.
Each compiler has its own way or mechanism to handle errors that occur
in source program. Obviously unacceptable modes of behavior are to
produce a system crash, to emit invalid output, or to merely quit on the
first detected error. At the very least, a compiler should attempt to recover
from each error and continue analyzing its input. It is in the method of
recovery and the type of continuation that compilers differ. A simple
compiler may stop all activities other than lexical and syntactic analysis
after the detection of the first error.
A more complex compiler may attempt to repair the error that is
transform the erroneous input into a similar but legal input on which
normal processing can be resumed. An even more sophisticated compiler
may attempt to correct the erroneous input by making a guess as to what
the user intended. No compiler can do true correction, and there are
convincing reasons why a compiler ought not to try.
One reason is that to do correction a compiler must know the intent of the
programmer. However, the true intent is often completely obscured by the
errors in the source program. Since completely accurate error correction
can be done only by the programmer, it is a task most compilers should
not waste time attempting.