CS 110: Elements of Computing. Instructor: Jim Aspnes
Due Friday, October 4th, 2002, at 5:00pm.
Using the Random Access Language described in Chapter 17 of Dewdney, write a program that writes 0 into memory locations 0 through 1,000,000 and then halts (by executing the HLT instruction). You may use any higher memory locations you like to store extra data needed by your program. If you need to assume that these other locations contain specific values when your program starts, explain what locations start with what values; however, you should not make any assumptions about the contents of locations 0 through 1,000,000, which may be arbitrary. You should write any numbers that appear in your program in the usual decimal notation (you don't need to bother with hexadecimal or binary for this problem). You are encouraged to explain how your program works.
Hint: it may be easiest to start at the top.
Write up an email message containing your full name and the answer to these problems in plain text format (this means no HTML or Microsoft word documents), and send it to aspnes+110-02-3@cs.yale.edu. (Note: this is not the same email address as for previous homework.)
0: LDA 1,000,003 1: STI 1,000,002 2: LDA 1,000,002 3: SUB 1,000,001 4: STA 1,000,002 5: JMZ 7 6: JMP 0 7: STA 0 8: HLT
For the last problem, you must submit every line of your program. Absurdly long programs (e.g. ones that contain a million STA instructions) are strongly discouraged.
Fri 20 Dec 2002 16:31:36 EST hw3.solutions.tyx Copyright © 2002 by Jim Aspnes