Computer Organization Lab #1: Program Zero

The purpose of this lab is to get set up with the program development environment we are going to be using. Our development platform will be Windows. You can use either your own computer or the school's Windows machines in the lab. Proceed as follows:

  1. Download and install the Open Watcom suite of compilers (C, C++, Fortran, and Assembly language). Unpack the zip archive in some suitable location. I recommend avoiding a path that contains spaces. Your profile home directory should be fine. Everything is contained in the WATCOM-20150715 folder that is created. There is no installer in the usual sense. To remove Open Watcom simply delete that folder.

  2. Download the simple C program hello.c. Open a console window and execute the batch file useOW.bat in the root of your Open Watcom installation. That batch file sets up some environment variables that are needed by the tools. You only need to execute the batch file once for each console window you open. If you are not familiar with Windows console commands you might find this summary of Windows commands useful.

  3. Compile the simple program using the following command:

            > wcl386 hello.c
          

    You should now have hello.obj and hello.exe in your working folder. Run the executable file to verify that it works.

  4. Download Program Zero and unpack it in a suitable folder. Execute the wmake command in that folder to build the program. Run its executable to see if it works. You will use "Program Zero" as a template from which you will create other programs in the future. Program Zero is a mixed C/Assembly language program that we'll use to explore both languages and their interactions.

  5. Use a text editor of your choice to edit the file library.asm. Change the increment instruction ("inc eax") to a decrement instruction ("dec eax"). Rebuild the program and try it. Can you guess what the decrement instruction does?


Last Revised: 2017-01-11
© Copyright 2017 by Peter C. Chapin <PChapin@vtc.vsc.edu>