Software
A key software tool used in this course is the
GNU C compiler gcc.
To install it on your PC, you have two options. If you are running
linux, you will already have the
compiler installed.
On the other hand,
if you are running a Microsoft based operating system, then the recommended option
is to install the DEV C++ development environment which provides a particular Windows
port of gcc together with a development environment. See the homepage for DEV C++ for
related documentation.
The glibc manual which provides detailed descriptions
of the standard library associated with this compiler, will be very useful to you. We use C in this course since,
millions of programmers can't be wrong.
Another key software tool used in ELEC3730 is the MSDOS Intel nasm assembler, which is contained in the following
zipped files:
However, this assembler will only work with PC's containing Intel chips (such as the ones in the laboratory). If you have a PC with an AMD64 chip inside, you will need to use this assemler instead, with documentation available at the YASM homepage .
It is possible to use the DEV C++ development environment to invoke the nasm assemler by following these steps:
- Create the new project: (File→New→Project) empty C project
- Add the C and assembly files to the project (set the file filter to "All files" instead of "all known files" to be able to see the .asm files)
- Under Project → Project Options
- Choose files tab
- Select the assembly file
- Tick "include in compilation" and "include in linking"
- In the "override build command" box, type
nasm -f win32 -o filename.o filename.asm
where "filename" is the name of your assembly file.These instructions assume that the project file is saved in the same folder as the source files.
Finally, a potentially annoying feature of using the DEVC++ development environment is that
when it runs executables, it pops the execution display window away immediately following termination of the program. This can be prevented by using the standard library "system" command, which can call underlying operating system functions, such as "pause". To be more specific, to stop the window being immediately popped away, use the following template, which in fact is automatically created for you in DEVC++ if you request "new project"
int main(int argc, char *argv[])
{
system("PAUSE");
return 0;
}