CSCI 112 Spring 2024
Exploring Computer Science
Archived Class
Charles Cusack
Computer Science
Hope College
Main
Schedule
Grading
Gradebook
Homework

Policies
Advice
College
    Policies

Notes
Programs
Tutorials

CSCI 125
CSCI 255
Others

Admin

Homework 10

Details

For each problem make sure you clearly and neatly show all of your work! Each part/problem is worth 5 points unless otherwise specified.

  1. Write a machine language program stored starting at address 00 that swaps the values in memory E4 and 8A. Give your answer in the same format as the program given in the next problem. Be sure to use one of the machine simulators to check your code! Also, please give the decoding of each instruction.
  2. Assume the following values are stored beginning at address 30:
    2003
    2101
    2200
    2310
    1400
    3410
    5221
    5331
    3239
    333B
    B248
    B038
    C000
    
    1. (15) Make a table with the instructions in the first column (e.g. 2003) and a translation of each instruction in the second column (e.g. Load R0 with the hexadecimal value 03).
    2. (5) Give a summary of what the program accomplishes. You will probably need to trace through the program in order to determine this. Feel free to use one of the online implementations of the machine to walk through the code. Note that I am not looking for a play-by-play of what each instruction does (you did that in (a)), but an overall description of what it accomplishes. (e.g. I want an answer like "sorts a list" instead of "looks through the list, finds the smallest element, swaps it to the beginning, and repeats until...")