Note: This assignment has been revised on Monday Sep-25, due
Tuesday Sep-26. Revision: Rewrite your answers so that they
adhere to the rules covering a Well-Formed
Assembly Language Program.
| Date Assigned: | Thu Sep-21 |
| Date Due: | Tue Sep-26 |
Note 1: This is due tomorrow, even for P4 students (who will not meet tomorrow due to rotation).
Note 2: Another assignment will be assigned by end of school tomorrow to be completed over the weekend, even for P4 students.
Note 3: Not only may you work in groups on this assignment, but it is very highly encouraged for this particular assignment. Please do so.
Note 4: Unlike most assignments, this assignment is due by end of school tomorrow and not by start of class.
1. For this question, simply indicate who you worked with and how long you worked with them on these issues.
1a. Install SimpSim on your home machine, or if you do not have a PC at home, use it in the computer lab or the library loft. If it is not on a machine, you can download it from the class website (accessible via http://www.sewickley.org). Go to the new software downloads link to at the course home page to find the software and the .asm files for the 3 example programs we are reviewing in class.2. For your answers here, submit the actual text of your programs. Do not submit the programs themselves as attachments. I want only a single file (or printed hardcopy) turned into me by end of day tomorrow.1b. Step through helloWorld.asm very, very carefully (this means not to use the run button, but rather the step button). For each step, discuss with your study partners what will happen before you hit step (which registers will change and how, which memory locations will change and how, what will the Program Counter read, what will the Instruction Register read, will anything get printed in the output window, will the program halt, etc). Then, hit step and discuss what did happen and verify that it matched your expectations (or discuss, if it didn't, why it didn't). Do this step after step until at least 5 letters are printed out. Also, look at the top of the helloWorld.asm file -- the comments mention many different aspects of assembly language which are demonstrated by the program. For each one, verify that you understand how it demonstrates that aspect.
1c. Consider the machine language for helloWorld.asm. For each line, verify that you understand why the machine language is what it is. Understand how labels get translated by the assembler into absolute memory references (so an assembly language program may say something like Load R8,MyLabel, but the machine language program does not include "MyLabel" but rather a real hex number in its place).
2a. Write a variant of helloWorld which prints out every other letter in the message. To do this, you simply increment by 2 instead of 1. However: you must also place a second 0 at the end of the data (think about this).2b. Write a program which compares the numbers stored in memory locations 0xF0 and 0xF1. If they are equal, your program should print out Equal (by loading the appropriate values into RF). If they are not equal, your program should print out Not equal. Hint: you will likely want to reuse most of the helloWorld.asm code in this program. Also, please print out a few linefeeds (decimal 10) before your output to make it easier to read.
See Course Home Page.