Questions and Answers
Note: new questions are appended at the end.
- Could you explain in personal email how FOO works?
- I (bsy) do not want to type in long explanations in email.
I have tendonitis, and would prefer to avoid typing unnecessarily.
If you have a question, come by my office and ask it to me face to face;
I can get better feedback on what your confused about,
and avoid typing explanations on parts that you already know and
give more details on what you don't.
- I see that you are logged on ieng9. I am trying to use
talk. Why don't you ever answer?
- The fact that you see me logged on with w or other
commands doesn't mean that I am actually sitting in front of my computer.
- How do I view the PostScript documents?
- You need to download a version of ghostview for your
operating system. Check out the usual software repositories (check
Yahoo and places like that). Or ask
- Can I telnet in to do work?
- It depends on the assignment. You need to be able to run
a web browser as a minimum. The early homework assignments can be
done by telnetting into ieng9. The later ones is harder. See the
- Do we need to put in comments explaining the logic of the
program that we write? Is the documentation style in, e.g.,
- Most definitely. You don't have the opportunity to
lecture to me or the graders about how your code works, so you must
write it down. Plus, in a real programming situation (e.g., when
you're working), your code will be picked up by other people after
you've moved on to other projects, and there will be
no opportunity for face-to-face explanations.
You need to put in comments explaining the logic to an audience that
knows the basics of the instruction set, but do not know what your
code is doing. You should have a ``block comment'' at the top which
explains the logic and the algorithm(s) used, and comments every few
lines which helps the reader understand how the actual code correspond
to the described algorithm.
- Are there other references to the macro assembler language?
- No. This is a macro assembler language that's been
designed especially for the One-Instruction Computer. While it has
many of the standard features found in most macro assemblers, it is
not exactly identical to any of them.
- If I use two or more .org statements, how do I
generate the .oic machine code file? I'll have gaps in the
- Use as many separate .oic output files as you
need, one for each contiguous region of memory.
- Can I assume that the macros that we went over in class
exists without (re)defining them?
- No. Do not assume that the macro assembler would have
any macros pre-defined. If you need to use a macro that we went over
in class, cut and paste its definition into your own files. Properly
speaking, each input file to the macro assembler starts from
``scratch'', so if you are using more than one masm files,
you should redefine each and every macro that you need again. You can
use an #include <macro-defns> directive
(just like in C or C++) if you want to write your macros only once and
place them in their own file.
- I'm having trouble compiling oic.c on my home
machine. What should I do?
- You may need to declare the getopt function and
variables if your compilers doesn't automatically know about them. This is:
int getopt(int argc, char *const *argv, const char *optlist);
extern int optind;
extern char *optarg;
I will not give more porting aid than this, since compilation
environments can differ wildly. Note: In any case,
you should verify that your programs work on ieng9, since that is the
machines where the graders will test your programs.
- Can I use spim at home?
- Yes. You can use the text-only version (spim)
through any connection to ieng9 (even a very slow modem). If
you want to use the X-Windows version (xspim), you need an X
server on your home machine (there might be freely available X servers
for Windows 95 and the Mac). You can't run xspim across the
wire without it (it will say that it can't find a DISPLAY).
I am told that there is also a native Windows version of spim
available through FTP (see the book, page A-40). This is certainly
going to be easier, and you won't need to be connected at all. In
case you are using it, make sure that your solution runs the same on
ieng9, as we won't go to your place to see it work.
NOTE: PCs are little-endian machines, whereas the
Suns are big-endian machines. If your code has endian dependencies,
then you will definitely have problems getting it to work on the Suns
if you first got it to work on a PC.
- Will the exam concentrate on the material in the book or
in the lecture.
- It will cover material from both. You'll find out the
concentration when you get the exam.
- How many elements of input are there in assignment 3?
- The number of elements per vector is equal to the dimension.
- Can I treat the input numbers (vector elements) as unsigned input?
- You should treat the input numbers for the oic
case as non-negative numbers. For the mips code, you must
follow the type declaration and treat them as integers.
- How do I use the provided MIPS driver to test our code?
- Place your code and the driver code in the same file, i.e.,
% cat driver.mips assn3.mips > all.mips
then load the resultant file all.mips into spim.
- Is there an .org statement for the MIPS assembler.
- No. There are optional arguments for the .text
and .data assembler directives. You should not have
to use these.
- Are the vectors for the MIPS dot product code interleaved
as in the case of the oic code?
- No. This is why there are three arguments to dotprod.
- Can I use the MIPS mul or mult (pseudo-)
instructions for assignment 3?
- You can use any instruction as you please, as long as
your code satisfies the specifications, i.e., it has the right
parameter and return types, it returns the dot product, and it follows the standard calling convention.
- Do you want us to turn in both the MIPS test driver code
and our subroutine together or separately?
- I want the MIPS subroutine in its own file. I should be
able to type in:
% cat your_subr.mips my_test_driver_5.mips > all.mips
% xspim -file all.mips
and see that it works.
- My code generates a syntax error. What might be wrong?
- There are many possibilities, include a genuine syntax
error. Your file may contain control-M characters because you wrote
your code on a Windows machine and did not specify text mode when you
uploaded it. Your file may contain a last line that does not end with
a newline character. These are conditions that will cause spim to
complain. There are doubtless others.
- What is meant by naive recursion? (In assn 4.)
- By that I mean use the standard calling convention and
actually recursively call, rather than implementing your own stack in
an array, or otherwise change the algorithm.
- Do we need to handle overflows?
- You do not need to handle overflows. If I want you to
handle overflows, I'll tell you explicitly how.
- Do we need to use tar even if we are turning in a single file?
- How do we make sure that our turnins work okay?
- This depends on many things, such as other students not
turning in huge files to cause quota problems. The usual way is:
assn1 assn2 assn3 assn4 assn5
% tar cf - assn5 | turnin -c cs30f
where all of the files to be turned in is in the assn5
subdirectory. You could also run this in several steps:
assn1 assn2 assn3 assn4 assn5
% tar cf assn5.tar assn5
% tar tvf assn5.tar
table of contents
% turnin -c cs30f < assn5.tar
- Are we required to turn in the code that we used to test
- You should turn that in. If your code does not work for
some of our test cases, we will look to see whether you've done
- In assignment 6, if our output looks different from
yours, is that okay?
- The order of the output from the various threads depend
on exact details of thread scheduling. You are required to implement
the priority right, but you may run newly initialized threads with a
scheduling sequence of "pause-run-pause-run" versus
"run-pause-run-pause", and that would create output that look
different. In both cases, however, the requested priority would still
be handled correctly.
| CSE home
| bsy's home page
| webster i/f
email@example.com, last updated Wed Dec 2 18:15:58 PST 1998.email bsy & tutors