Description

The Assignment can be found at this link: https://phobos.ramapo.edu/~vmiller/SoftwareDesign/VC8000Design.htm

The Project:

The term project for this semester to the create an assembler and emulator for the VC8000 computer.

  1. An assembler is a program that translates a program written in assembly language (symbolic machine language) into machine language.
  2. An emulator is a program that imitates a specified machine. So, if you give it a machine language program for that machine, it will be able to run it. Emulators are important in the support of apps creation. What does this mean?
  3. Note: the VC8000 computer is quite different from the VC1620 of last semester.

The Design Process for creating an Assembler for the VC8000 computer – we will first get the requirements for the project.

  1. We will discuss the VC8000 machine language from the link. VC8000.
  2. We will discuss the format of an assembly language for the VC8000 computer. Use the VC8000 Assembler handout. This is part of getting the requirements for the project.
  3. Take a look at the output that is expected for this project. Typical Output VC8000. This is part of getting the requirements for the project. Note: your project must be able to successfully generate this output in order to be accepted. You should do the emulator, but you will not automatically fail the course if you do not finish the emulator. But, it will hurt your grade if you don’t complete it.

    At this point we have the requirements for the project.

  4. To understand the concepts of creating an assembler, go through the steps of translating an assembler language program. We will do this together in class.
  5. Create a list of the elements of the project. My list is below from when I did this alone. We will probably have a somewhat different list when doing this in class.
    File access.
  6. Error processing is a major part of an real-world project. All errors should be reported in the second pass, immediately after the offending statement has been displayed. You will not stop translating after you reported the first error. All errors will be reported and the assembler will translate as much as it can after the error. We will list errors together. Below is a list that I wrote up.
    1. Multiply defined labels. (Reported after the offending statements.)
    2. Undefined label. Namely, a symbolic operand does not have a matching a label.
    3. Syntax error in construction of the label or operands. For example, the operand of a DS must be numeric and those of an ADD instruction must be symbolic. Labels and operand must meet the format given in the specifications.
    4. Illegal operation code.
    5. Insufficient memory for the translation.
    6. Missing end statement or the end statement is not the last one in the program.
    7. Constant too large for VC8000 memory.
    8. Missing or extra operands

  7. Error processing for the emulation will be simple. Just report the location where you find the first instruction that cannot be executed, indicate the problem, and terminate.
  8. In writing a C++ project of this size the first step in the program design is to determine the classes needed for this effort. A common mistake of entry level programmers and some academics is to have too many classes. Some programmers do not create enough classes. See Class Design for the C++ class definitions for the assembler. We are matching the classes to the functionality discovered earlier. There may be more classes added later.
  9. The next step is to develop class definitions for each of the needed classes. This will be followed by a top down implementation of the Assembler. (Why top down?????) We give a quick look and then come back after some preliminary material. Based on the support from our class, I have created the following link to improve class definitions for this project: Improved class definitions.
  10. Testing should be done using a debugger and other programming tools.

Debugger

In order to do effective software development, it is necessary to use development tools. I assume that you are comfortable with Visual Studio. This will supply us with an editor, a C++ compiler, a debugger, online help, and a profiler. It is a development environment. If you live in the UNIX world, Eclipse which uses the GNU C++ compiler and the GNU debugger provide a fine development environment. I will demo the Eclipse for C++ development later in the semester.

Libraries

No boss is happy if you rewrite existing code. You should make as much use as possible of existing code. C and C++ both have standard libraries. STL is supported in C++. Also, there are libraries that may be purchased or free(e.g. Boost) and libraries that your company has produced. As an example, consider the fact that you will have be able to search the symbol table and display it in alphabetical order. STL provides tools to do this. The standard C library also supplies this functionality. See qsort and bsearch for a description a sort and a search function. If there is time, I will describe these because their prototypes are unusual and good to know the weirdness. Also, you should try to take full advantage of other built-in features of C++.

Coding Standards

Almost every well managed company will have a set of programming standards which the programmers are expected to follow. I have created some professional standards that I expect to follow in your project. Despite the fact that they might seem to require a lot of extra effort, these coding standards will assist you in completing your project on time.