Introduction to Project

The XM3 is a machine that supports thirty two 16-bit instructions , has eight 16-bit registers, has eight pre-defined constants (0, 1, 2, 4, 8, 16, 31, and -1), has a 16-bit bus, and has a 64-kib memory. At the moment an assembler exists for the XM3 machine which translates programs written using the XM3 instruction set into machine code for the XM3 machine.

The goal of our project is to create a compiler that will take in C as a source language and produce an equivalent program using the XM3 instruction set that can be run through the XM3 assembler to produce machine code for the XM3. Building the compiler can be broken into 3 overall steps:

  • The Frontend: Will take in C programs and transform them from a stream of characters to an intermediate representation.
  • Intermediate Representation: The C program is now in a form that is neither XM3 assembly (target language) or C (source language). The purpose of this stage is to optimize and manipulate the original program before translating it to the target language.
  • The Backend: The intermediate representation will now be mapped into the instruction set of the XM3 machine.

Furthermore, additional goals of our project include creating a linker (used to link object files into a single executable) and a monitor (used to load programs onto the XM3 machine) to work with the compiler.

Meet the team

This project is sponsored by Larry Hughes and is part of a fourth year computer and electrical engineering design course at Dalhousie University. Team members include (from left to right):

  • Jacob MacDonald
  • Manav Sohi
  • Aidan Nearing