Chapter 4
Programs
4.1 Objective
To b ecome familiar with writing programs. This lab also illustrates the use of
assembler directives.
4.2 What you should do
You will have to turn in your LST files for the programs you write for this lab.
Check with the TA for additional instructions.
4.3 Programs
When you write programs in a high level language such as C, C++, Java, the
compiler facilitates modular program development using function. In an earlier
lab, we discussed some basic rules for writing functions. Another facility that
higher level languages provides is the use of variables. Key features of variables
in high level languages are:
1. Variables generally have a name and you use the name to manipulate them.
2. Variables have a type. The compiler keeps track of the type and makes sure
that the way a variable is used conforms to its type.
3. Compiler negotiates with the operating system to obtain adequate memory
for the variable.
4. Compiler makes sure that a memory allocated to a variable is not acciden-
tally also allocated to another variable
49
Comentarios a estos manuales