CSC 101 CompLit, Fall 1996
Merrie Bergmann
Ileana Streinu
Dominique Thiébaut

Homework 7

Due Wednesday, ? 1996, by midnight

This HW concentrates on Pippin assembly language programs. You are to write one program, and study three more. One file is to be deposited into the DropBox, and you are to send me one email message.

(1) 2X=Y

Write a program that will put a 1 into the accumulator if 2X=Y, and a 0 otherwise, where X and Y are the contents of two specific memory locations; please use [2] and [3]. This program is something of a mixture of the 2X and X=Y programs we used in Lab 7.

Save your program under the Pips/SaveAs... menu option, and call it H7.Last.First.

(2) Mystery 2

This program takes a positive number X as input in location [2], performs some mysterious computation, and leaves a 1 or a 0 in the accumulator (the -1 in [2] is what was left after it finished, so ignore that). You should view the numer in [2] as input, and the accumulator as output. This program is very similar to the Mystery 1 program from Lab 7.

Key in the program and run it for several numbers starting in [2], and observe what it leaves in the accumulator. Guess the computation it is performing, and check out your hypothesis. Write down as precisely and clearly as you can a desription of what relationship the 1 or 0 left in the accumulator bears to the number input in [2].






(3) Mystery 3

This program takes a positive number X as input in location [2], performs some mysterious computation, and leaves a result in location [3]. Key in the program and run it for several numbers starting in [2], and observe what is left in [3]. Guess the computation it is performing, and check out your hypothesis; you should view [2] as input and [3] as output. Write down as precisely and clearly as you can a desription of what relationship the number left in [3] bears to the number input in [2].













(4) Mystery 4

This program takes one number input in [19], performs some mysterious computation (that alters the contents of both [17] and [18]), and leaves a result in location [18]. You should view [19] as the input, and [18] as the output. If you start it with 10 in [19], it halts with 55 in [18] (shown below). Key in the program, run, guess, test, and write down your description. Hint: Reading the Pippin Assembler section of Chapter 5 (187-192) will help.

Send email to me (orourke on sophia) with your explanations of Mystery programs 2, 3, and 4. Deposit H7.Last.First into the DropBox. All by Thurs 11 Apr 1:00PM.