CS530 Assignment 1 Questions and Answers

----------------------------------------------------------------------

What is the input for the program?

The program will take a single argument, the name of a file, which the program will open and read.


When do we do the second pass?

That's not part of this assignment. You don't need the specification for the second pass of the assembler -- you should do as much of the work as possible in the first pass, and then document in your design what work you are leaving for the second pass.


Can I create temporary file to hold the symbol table?

No. You may certainly consider this in your design, and abstract the output mechanism accordingly. A good design will have only one printf() or System.out.println() invocation. Naturally, you may end up with more for debugging purposes.


When will you give us the sample input files?

By monday, feb. 10, 2003, if all goes well. I have a list of things I am preparing for you, and that is on the list. When I have them ready, a pointer to them will go up on the web-page.

A sample input file and a sample output file are now available.

For the sample input #3, there is an annotated version that includes the object code for those lines that would generate a text record.


Should my program return an error code?

Yes. Note that in C, stdlib.h defines EXIT_SUCCESS and EXIT_FAILURE, you should use these. Java programmers should look up the value for these C symbols and define their own constants.


Do you have templates for our method/function comments?

Yes. I have comment templates for:


When is the Program Counter incremented?

The program counter in the SIC machine is incremented after the instruction has been loaded, but before it is executed. Thus, for Format 3 instruction at location 300, the program counter has a value of 303 when that instruction is executing.


In the line format, where are the required and optional spaces?

According to the SIC/EM specification each assembly statement is of the form:

 MNEMONIC MODE OPERAND MODIFIER ;COMMENT 
The + notation to indicate Format 4 instructions may be considered to be part of the mnemonic. After the mnemonic and before the mode, at least one whitespace character is required. After the mode and before the operand, and after the operand and before the modifer, and again before the comment, spaces are optional, but may be present. (In this context, "whitespace" is taken to be tabs or spaces, but good modular design would indicate that you should be able to add or change the characters that you consider to be 'whitespace' -- a simple change with an editor and a recompile is all that should be needed to add underscores ('_') to the list of whitespace characters, for example.)


What constitutes an expression for this assignment?

Other symbols, possibly added or subtracted from one another. Note that expressions only occur in psuedo-operations.


What is the late turnin policy?

If you turn in a program late, you lose 5% a day, up to four days. After that, the program will not be accepted. Don't forget that a turnin is mail from your class MASC account on rohan. Don't wait until the last second to turn in a late assignment -- weigh the risks carefully.



---------------------------------------------------------------------- $Id: questions.html,v 1.9 2003/03/06 07:56:03 stremler Exp stremler $