CS341 - Intro. to Computer Architecture and Organization - Professor Ackley

Tuesday and Thursday: 9:30am - 10:45am (Centennial 1028) Lab: Friday 2:00pm - 2:50pm (Centennial B146)

Writing Y86

Goals

  • Write Y86 Mini Programs
  • Assemble using YAS
  • Simulate

Needs


//TODO

You are given 3 "stubs" of a Y86 program. Each follows a pretty standard formula:

  1. The expectation of the program is explained to you.
  2. Some set-up (registers initialized, etc.) is done for you.
  3. A chunk of code where you should implement the program is commented out.
  4. Auto-graded check for correctness wraps up the program.

You need to fill in the part of the program bookended by the # WRITE ASSEMBLY CODE HERE # comments with Y86 assembly that fulfills the expectation of the program. Once finished with your Y86 instructions, you can test your solution by assembling your .ys file into a .yo file by passing it to the YAS (Y86 Assembler). This is easily done by saving your .ys file in the /y86-code/ directory (see the Y86 Simulator Lab for reference) and typing make FILENAME.yo where FILENAME is the name of the .ys file, sans the ".ys" extension. If any errors are produced when trying to assemble (most likely there will be some on your first or second try having to do with syntax, instructions etc.) they will be printed to the console. Once finished, this will assemble your FILENAME.ys assembly file into object code that is ready to be run on the simulator.

To simulate the execution of one of your newly created .yo file (using SEQ), try the following steps:

  1. :$ cd seq
  2. :$ ./ssim -g ../y86-code/FILENAME.yo

The %eax register will contain 1 if your solution is correct. Anything else in %eax means the program did not accomplish what was intended.

DO NOT change any code outside of the # WRITE ASSEMBLY CODE HERE # comments.


HINTS


Turn-in

Through the online interface.