Getting Started

Part of the 22C:60 (CS:2630) on-line collection, Fall 2008
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

You may find to be useful. If you work in room 301 MLH, you will have direct access to the computers. If you want to work over the Internet, see for advice.

From a Mac or a Linux machine, you will be able to use the lab machines directly using the ssh command from a terminal window, and the scp command can be used for uploads and downloads. All of the tools used in this course run equally well under MacOS and Linux.

a windows machine, you will want to use SecureCRT, available as a free download from http:; SecureCRT includes an upload/download tool.

To run a program through the SMAL assembler, you will have to edit the file .cshrc in your home directory on the lab machines. The leading dot is part of the file name, and note, file names starting with dot are not listed when you list a directory with the ls shell command. Use the ls -a command to list all the files in your directory, including the hidden files.

You can use any text editor on these machines. Change the file so it looks like this:

source /etc/CSHRC

... (there may be additional content here, don't change it)

# Add personal Customizations here.
alias smal ~jones/bin/smal32 -U ~jones/lib/hawk
alias link ~jones/bin/hawklink
alias hawk ~jones/bin/hawk

The last 3 lines above, starting with the word alias are the lines you will need to add. After doing this, log out and back in again in order to activate the smal, link and hawk commands.

Now, if you have a SMAL source file, say a file named myfile.a, you can assemble it with the shell command smal myfile.a. When you do this, the assembler will produce a listing file called myfile.l and an object file called myfile.o.

If there are no assembler errors, you can link the object file with the shell command link myfile.o. This will produce a Hawk executable called link.o. If there are no linker errors, you can run the executable with the command hawk link.o.

To print SMAL assembly listing files such as myfile.l in room 301 MLH, lp -o landscape myfile.l seems to work well. There are a myriad of ways to print files locally. In general, try for printing in a fixed font in landscape format.

How you access the departmental Linux machines from your personal computer depends on several variables. On a personal Linux or Mac computer, you can open a shell window and use ssh for terminal access and scp for upload and download. There is a help page on these tools at

If you are working from a Windows PC, you can use Secure CRT to make an SSH connection. For documentation, see

Note that the default port for SSH connecitons is port 22, and this has been disabled for off campus access due to security problems. Off-campus users will need to use an alternate port (30022 or 40) or establish a VPN connection to the campus network using Cisco AnyConnect. For help with this, see:

Another option for off-campus PC users in No Machine, a Windows application that gives you a Linux desktop. For help, see

Other Shells (Advanced Users)

Linux systems support several alternative shells (command line interpreters). The above instructions are written in terms of the default configuration on our departmental servers, where the default shell is tcsh and, on startup, this reads commands from the file .tcshrc, which, in turn reads from .cshrc where your changes go. If your .tcshrc has been customized so that it does not read .cshrc you may have to put the aliases in .tcshrc (at the very end).

You can check what shell you are running with the command echo $SHELL. On modern systems, the output will usually be either /bin/tcsh (meaning tcsh) or /bin/bash. In the latter case, you are using the bash shell, so you will need to put the aliases where bash wants them.

On startup, bash reads commands from .bashrc (there is a pattern here, the rc ending on the file name means "read commands"). The usual .bashrc file these days includes a line to check if there is a file named .bash_aliases. If that line is in your .bashrc, then your aliases go in the .bash_aliases file. Otherwise, they go at the end of the .bashrc file.

But note: The bash shell uses a different form of the alias command. If you are using bash, you will need to use the following alias commands:

alias smal='~jones/bin/smal32 -U ~jones/lib/hawk'
alias link='~jones/bin/hawklink'
alias hawk='~jones/bin/hawk'

These little incompatabilities between the different Unix/Linux shells are precisely why, once you get used to one shell, it is better to stick with it than to switch back and forth.