Skip to main content
Utah's Foremost Platform for Undergraduate Research Presentation
2021 Abstracts

Constructing an Assembler and Virtual Machine

Presenter: Devin Wright, College of Engineering and Technology, Computer Science
Authors: Devin Wright
Faculty Advisor: Curtis Welborn, College of Engineering and Technology, Computer Science
Institution: Utah Valley University

In the first half of the Computer Science track Capstone, students design and build a RISC-based assembler (ASM) and virtual machine (VM) from scratch. This project is completed by a single individual; group projects and collaboration of any kind is prohibited. Students must also implement assembly programs to demonstrate their ASM/VM and all of the required features function properly. For Project 1, students build a 2-pass ASM and a VM capable of the sequential execution of code. In the first pass, proper syntax is verified and the symbol table is created. In the second pass, byte code is generated and loaded into the VM’s memory. The VM interprets and executes the byte code. This phase’s assembly program is a sequence of mathematical operations that displays formatted results to the console. Project 2 adds register indirect addressing capability and branching instructions. This phase’s assembly program implements if-else statements and loops that perform various operations on arrays. For Project 3, registers are implemented for creating activation records on the run-time stack in the ASM/VM, along with an instruction that allows character data to be read from the terminal. This phase’s assembly program implements non-recursive functions and reinforces control structure concepts. The large assembly program required tests whether students’ coding skills can scale up. Project 4 has three parts. In parts 1 and 2, students refine what they learn in projects 2 and 3 by implementing a recursive function and performing more array processing. For part 3, students add instructions that implement thread stacks to allow the recursive function from parts 1 and 2 to execute on multiple non-native threads. The ASM/VM constructed during the first half of the Capstone is utilized during the second half where students will then implement an object-based compiler for their personally-constructed VM.