CS 211: The A5800 Assembler
Back to assignment page

Download and build it

Here is a link to the assembler source tarball. You’ll want to get it onto a system that can do make and GCC or some other reasonably sane compiler. (You’ll probably have to change the options in the Makefile if you’re not using GCC.) Once you’ve downloaded the tarball, extract it:

  $ gunzip -c a5800-assembler.tgz | tar -xvf -

  $ cd a5800-assembler/

It comes with a Makefile; if you want it to dump semi-gory debugging output or if you’re using a compiler other than GCC, you’ll need to edit it. Also, if you have no objdump, you’ll want to set the OBJDUMP variable to echo instead of objdump.

To build the assembler, run make in the assembler directory. If all goes well, you should have the a5800as binary sitting there; this is what you run to assemble things.

Running the assembler

If you need command-line help, you can always run a5800as --help and it’ll tell you things. Here are the options that the assembler takes:

-o FILESets the output image file. If you don’t set this, it dumps to standard output.
-l FILESets the listing file. The bytes and instructions that were assembled, as well as the output addresses, are written to this file.
FILESets the input file. By default, this is standard input.

More to come...

I’ll get the features of the assembler documented soon; for now, it is very alpha. I’ve tested it enough to make sure it works for me, and if I find something wrong I’ll update the source here.