COP3402, Fall 2000, Assignment 1

Due Wednesday, 9/14 at the start of class

Instructions for handing in the homework

  1. All solutions must be typed. Show your work for partial credit. I will not accept a homework if it is not typed. Be sure that your name is on the printout. You must attest that you did the homework on your own.
  2. Hand in a printout of the assignment at the start of class. Sign the printout.
  3. Upload a text version of the assignment via the web. If you use a word processor to do the homework, be sure that you save the file as text, not in the word processor's format. Submitting homework on-line.

For the following numbers

  1. (1 point) What 20-bit address is specified if the CS register holds 1B73h, and the IP register holds 70EFh?
  2. (1 point) What is the difference between SRAM and DRAM?
  3. (6 points) Perform the following arithmetic. For each one, assume that no more digits can be displayed than are already shown. Also for each number, indicate what the Carry and Overflow bits would be in the flags register.

    1. 11110110b
      + 10110111b

    2. 7E34h
      + 62DAh

  4. (2 points) What decimal number does each of the following SIGNED numbers represent?

    1. (8 bits) 11010011b
    2. (32 bits) FFFFFFE4h

  5. (4 points) Perform the following conversions. Assume the numbers are unsigned.

    1. Change AFFDh to binary

    2. Change 111010001b to hex

    3. Change 399d to binary

    4. Change 753d to hex

  6. (1 point) What is the range of signed numbers that can be represented in 16 bits?

  7. (1 point) What is the range of unsigned numbers that can be represented in 8 bits?

  8. (2 points) Write the Assembler commands that will do the following. I want one command for each step, do not combine 2 steps into 1. Assume that all numbers are in hex.
    1. Initialize the ax register to 20
    2. Add F to the ax register
    3. Initialize the bx register to 4E
    4. Subtract 40 from bx (use the SUB instruction)
    5. Subtract bx from ax
    6. Store ax into memory, at a reasonable location
    7. Terminate the program

  9. (2 points) Write the equivalent machine code program for the assembler code that you wrote in question 10. List the machine code for each instruction next to each assembly instuction as I did in class, and as is shown in the text. (Hint: use debug. However, only list the machine code for your instructions.)