Web Resources for CS3650
Final exam for this section only:
10:30 am - 12:30 pm, Tues., Shillman Hall 105, Dec 15, 2015
A Midterm Review
is now online. (Midterm to be given Nov. 6.)
There is a free course
on GPU computing. (Note that GPU computing is not
directly related to GPU graphics programming (OpenGL, DirectX).)
If this course interests you, please click on the above link
for the "free course".
Syllabus and outline.
HW7 is now available in the homework directory. Python
references are in python directory .
Here are some immediate resources in the course for doing homework, following
the readings, etc.
- The homework subdirectory
contains all course homework.
The course directory includes a help directory.
There are two older reviews of UNIX there, and better ones
exist on the Web.
Please also note the directory for
UNIX (Linux) editors.
You will need to login to a Linux machine to use these.
They are in /course/cs3650/unix-editors. For example,
to learn vi (estimated time: one hour), login to Linux and do:
and follow the on-screen instructions.
Appendix B from Appendix B of 4th edition of text,
or Appendix A of 3rd edition of text, is also online
(requires CCIS Linux password).
It is the manual for
MIPS Assembly language. Read it, and re-read it.
- Portions of the rest of
an older edition of the text CD
are also available online (requires CCIS password).
Some help files for Linux and its compilers,
editors, etc. are also available.
As you use Linux, please look into using gdb
(GNU debugger), which will help you greatly in debugging. This will
help when you test your homeworks on our Linux machines.
There is also a good, free
on-line C book by Mike Banahan, Declan Brady and Mark Doran.
If you use Windows, there is a free, open-source IDE (Integrated
Development Environment) for C/C++,
Homeworks must be handed in using C, but this is a subset of C++.
When your code works, you must still test it under Linux:
If it doesn't work on our Linux system, it will be graded
as not working.
gcc myfile.c; ./a.out
Additional help available: Upper Class Tutoring (but please do also come to my office hours)
Course textbooks (including source code) for
second half of the course:
MIPS Simulator for Assembly Language homework (MARS):
- There is a
MIPS Assembly language simulator with
free downloads available and
online documentation. For your convenience, a copy of
the simulator is at: MIPS-simulator.
- To begin running the simulator, go inside the folder, and
double-click on the Mars.jar icon. Alternatively, if running
from the command line in Linux, type:
java -jar Mars.jar
If you download Mars.jar for your computer, there are also
suggestions on that page for running Mars.
- The syntax of the assembly language is intended to be compatible
with Appendix B of our textbook (also
(requires CCIS password).
- The software is distributed as a Java .jar file. It requires
Java J2SE 1.5 or later. Depending on your configuration,
you may be able to directly open it from the download menu.
If you have trouble, or if you prefer to run from the
command line on your own computer, the Java SDK is is also available
for free download from the same download page. The instructions
for running it from Windows or DOS should work equally well
on Linux. The CCIS machines should already have
the necessary Java SDK installed.
- GOTCHAS: There are several important things to watch out for.
- When you hit the "Assemble" menu item, any error messages about
failure to assemble are in the
bottom window pane, tab: "Mars Messages".
Input/Output is in the bottom window pane, tab: "Run I/O"
- If you paste assembly code into the edit window pane, you must
save that code to a file before Mars will let you assemble it.
- If you have selected a box with your mouse (e.g. "Value" box in
the data window pane, or "Register" box), then Mars will not
update the value in that box. Mars assumes you prefer to write
your own value into that box, and not to allow the assembly
program to use that box.
- If your program stops at an error, read the "Mars Messages" for
the cause of the error, and then hit the "Backstep" menu item
to see what caused that error. Continue hitting "Backstep"
or "Singlestep" in order to identify the error.
- Your main routine must call the "exit" system call to terminate.
It may not simply call return ("jr $ra"). Note that page B-44
of Appendix B of the text (fourth edition) has a table of
"system services" (system calls). These allow you to do "exit"
and also I/O.
- One of the nicer features of this software is a limited
backstep capability (opposite of single-step) for debugging.
In addition, the help menu includes a short summary
of the MIPS assembly instructions.
In general, I like this IDE for assembly even better than some
of the IDEs that I have seen for C/C++/Java.
(The one feature that I found
a little unintuitive is that if you want to look at the
stack (for example) instead of data, you must go to the
Data Segment window pane, and use the drop-down menu at the
bottom of that pane to choose "current $sp" instead of ".data".)
- Please note the
three sample assembly programs, along with an accompanying
tutorial on the same web page.
- I'd appreciate if if you could be on the lookout
for any unusual issues, and report them promptly (along with
possible workarounds), so the rest of the class can benefit.
Thanks very much for your help on this.
The GNU debugger
GDB (GNU DeBugger):
A Few Simple Debugging Commands Save You Hours of Work
NOTE: For those who like a
full-screen display of the current code, try the command ^Xa (ctrl-X a)
to turn full-screen mode on and off.
Example: gdb --args ./a.out
COMMON gdb COMMANDS:
next, step, finish (next line, step inside fnc, finish current fnc)
where, frame, list (e.g.: where; frame 0; list)
ptype, print ( ptype argv; print argv )
< Cursor keys work, TAB provides auto-complete >
set follow-fork-mode child (needed for debugging child process in shell)
IF PROGRAM IS IN INFINITE LOOP, TYPE ^C (ctrl-C) TO TALK TO gdb.
help e.g.: (gdb) help continue