Frequently asked questions on Pass 2:
Where do I get the example2 files for pass 2?
The two files: example2.int and example2.sym,
that are shown in the pass 2 assignment handout, will be copied
to your directory if you type make data2
at the Olympus prompt. I haven't put any files on-line for testing
errors yet.
Do I have to fix any errors in my pass 1 before I write pass 2?
No, pass 1 and pass 2 will be graded separately, if there were
errors in your pass 1, it won't affect your pass 2.
Is anything from pass 1 used when running pass 2?
Pass 2 should be written to be completely independent from pass 1.
That means that you should act as if pass 1 didn't even execute before
pass 2. Pass 2 will prompt the user for the input file name and read
both the intermediate file and the symbol table files that we provided,
not the ones from your pass 1's output.
If you want to use any functions or constants or
structs from your pass 1, just copy them into the pass2.c file.
How do I keep my pass 1 from getting in the way?
The easiest way is to move your pass 1 out of the directory where
you are working on pass 2 (saving it on floppy or in some other
directory) and get the original pass1.c file from Olympus.
Don't just run make setup again, that will write over
everything, but use:
cp /home/cop3402/project/pass1.c .
to copy just the pass1.c file. Then, when you compile using
make asm , it will use the dummy pass1.c which does nothing.
Again, make sure that you have saved your pass1.c somewhere else
before you copy in the original pass1.c!
How will we submit pass 2?
You will submit pass 2 in the same way as you submitted pass 1, but
only assembler.h and pass2.c will be used for grading.
In Pass 1, when we output the value of numeric constants into the
symbol table they were in the same format (decimal, binary, hexadecimal)
that they appeared in the input file. But, in the Pass 2 example files
the numeric constants in the symbol table are all shown in decimal format.
Which is correct?
For Pass 2 you should expect that the symbol table will look like it
does in the Pass 2 assignment handout. I converted the numeric constants
to decimal to make it easier to read the symbol table. Remember that
the address column on the right side is in hexadecimal but the number
of bytes in the second column of the table is in decimal. Also, note
that the symbol table file does not include the header line shown in
the assignment (the line that says "identifier", "size", etc.).
I thought that you said that the symbol table file doesn't contain
the header line (the line that says "identifier", "size", etc.) that is
in the handout... but the file example2.sym DOES include the
header line!!! What happened???
Is that it? That's all you are going to say?? What are we supposed
to do now??? Do we expect to have the header line or don't we????
Oh, so now I'm supposed to fix your problems... Alright, since
the header line has been there all along and several people have submitted
pass2 already (yes, there are people in the class who don't wait until
the last minute) then the way I will handle it is to leave it in the
symbol table and you can do an fgets() to read the first line and
then just throw that line away.
So, to make it very clear, the symbol table file will contain
a header line. Deal with it!
Once again, exactly what errors do we look for in Pass 2?
Just those that Pass 1 didn't (if you had written it correctly) find:
- undefined labels, data variables or externs in the .CODE section
- an extern that is not declared as a DEFX in the .DATA section
or a DEFX in the .DATA section that is not in the .EXTERN section
- immediate values (type I and type III only) that are too large
for the instruction.