Computer Organization and Assembly Language Programming

22C:18/108

Homework 4: Due Monday, 2/20/95

Problem 1: [10 points]

Suppose that

For each of the following independent instructions, determine if the instruction is a valid MC68000 instruction or not. For each valid instruction, write down the following: (a) size of the instruction (in bytes), (b) number of memory accesses required to execute the instruction, and (c) the contents of the destination after the execution of the instruction.

  1. MOVE.B I.W, D0
  2. ADDI.L #$FFFFFFFF, D1
  3. EOR.L I, D1
  4. MULU #10, D0
  5. MULS #10, D0
  6. NOT.L D1
  7. ADD.W #10, I
  8. SUB.W #'0', D1
  9. MOVE.L D0, A0
  10. ANDI.W #%0000000000000111, D1

Problem 2: [7 points]

This problem is relevant to Project 1. Write an MC68000 program that reads a positive integer in the range 0 through 15 and prints the equivalent hexadecimal digit. Do not use the hexout subroutine. Write legibly and comment your code.

Problem 3: [8 points]

This is to give you some experience using strin and strout. Write a program that reads your first name and your last name, each specified in a separate line. Assume that each name is at most 10 characters long and is typed starting in column 1 of the corresponding line. The program produces as output the message:

Your name is last_name, first_name

Write legibly and comment your code.