Home Work No.1

Please submit a HARD COPY of Your Report

on Aug 29, 2007

  1. Create a new empty project in .NET environment.(OS : MS Windows, Processor: Pentium).
  2. Write a simple C++ program to compute the following expression:

f=(i+k)-(h-g);

All variables are 32-bit integers, you may select any initial values ( you may use negative values as well).

No input/ouput is needed in this exercise.

  1. Compile the program
  2. Run the program in DEBUG mode! ( How to FIX ERROR MSG!)
  3. Use single step execution.
  4. Display the following windows:
    1. Disassembly window,
    2. Register window,
    3. Memory window

Please answer the following questions:

  1. After each step record the values of registers ( in hex and in Decimal) .
  2. Determine the memory addresses of variables f, i, k, h, g.
  3. Determine the values of variables f, i, k, h, g in memory ( in hex and in Decimal).
  4. What addressing mode is used to access these variables?
    1. Relative ( if relative , what is the name of the base register, its value, if you can, please specify the offset to each variable f, i, k, h, g in memory).
    2. Absolute ( if absolute, what is the segment and the address)?
    3. Where in memory these variables are stored?

  5. Determine the addresses of all machine instructions in your program.
  6. Please write down all machine instructions that correspond to your C code and store them in order in a separate file ( you will use it later).