Questions and Answers


Note: new questions are appended at the end.
Q:
Could you explain in personal email how FOO works?
A:
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.
Q:
I see that you are logged on ieng9. I am trying to use talk. Why don't you ever answer?
A:
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.
Q:
How do I view the PostScript documents?
A:
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 your ISP.
Q:
Can I telnet in to do work?
A:
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 next question.
Q:
Do we need to put in comments explaining the logic of the program that we write? Is the documentation style in, e.g., subr-main.masm, subr-main.asm, and oic sufficient. new!
Q:
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.

Q:
Are there other references to the macro assembler language?
A:
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.
Q:
If I use two or more .org statements, how do I generate the .oic machine code file? I'll have gaps in the memory.
A:
Use as many separate .oic output files as you need, one for each contiguous region of memory.
Q:
Can I assume that the macros that we went over in class exists without (re)defining them?
A:
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.
Q:
I'm having trouble compiling oic.c on my home machine. What should I do?
A:
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.
Q:
Can I use spim at home?
A:
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.

Q:
Will the exam concentrate on the material in the book or in the lecture.
A:
It will cover material from both. You'll find out the concentration when you get the exam.
Q:
How many elements of input are there in assignment 3?
A:
The number of elements per vector is equal to the dimension.
Q:
Can I treat the input numbers (vector elements) as unsigned input?
A:
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.
Q:
How do I use the provided MIPS driver to test our code?
A:
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.
Q:
Is there an .org statement for the MIPS assembler.
A:
No. There are optional arguments for the .text and .data assembler directives. You should not have to use these.
Q:
Are the vectors for the MIPS dot product code interleaved as in the case of the oic code?
A:
No. This is why there are three arguments to dotprod.
Q:
Can I use the MIPS mul or mult (pseudo-) instructions for assignment 3?
A:
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.
Q:
Do you want us to turn in both the MIPS test driver code and our subroutine together or separately?
A:
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.
Q:
My code generates a syntax error. What might be wrong?
A:
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.
Q:
What is meant by naive recursion? (In assn 4.)
A:
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.
Q:
Do we need to handle overflows?
A:
You do not need to handle overflows. If I want you to handle overflows, I'll tell you explicitly how.
Q:
Do we need to use tar even if we are turning in a single file?
A:
No.
Q:
How do we make sure that our turnins work okay?
A:
This depends on many things, such as other students not turning in huge files to cause quota problems. The usual way is:
% ls
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:
% ls
assn1	assn2	assn3	assn4	assn5
% tar cf assn5.tar assn5
% tar tvf assn5.tar
 table of contents 
% turnin -c cs30f < assn5.tar
Q:
Are we required to turn in the code that we used to test our program?
A:
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 adequate testing.
Q:
In assignment 6, if our output looks different from yours, is that okay?
A:
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.

[ search CSE | CSE home | bsy's home page | webster i/f | yahoo | hotbot | lycos | altavista ]
picture of bsy

bsy+www@cs.ucsd.edu, last updated Wed Dec 2 18:15:58 PST 1998.

email bsy & tutors


Don't make me hand over my privacy keys!