IUP Computer Science
CO 300 Spring 2000

Program #1 (Due 5 pm 7 February)

Write a VAX assembly language program that examines ten data values (longword integers) and calculates the sum of excesses of the data values above 100, the average excess, the number of data values that have excess, and the number of data values that have no excess. For example, a data value of 103 has an excess of 3; a data value of 56 has no excess. By the time the program finishes execution, the sum and average excess and the two counts must be stored in separately named memory locations within the program.

The ten data values must be the ones listed below and must be in order:

 206     133     101     285     85     79     14     108     124     51

For this data, the sum is 357, the average is 59, there are 6 values with excess, and 4 values with no excess. Compile the program with the /DEBUG and /LIST switches and link the program with the /DEBUG switch. Then, run the program and perform the following actions IN ORDER.

  1. Set up a debug log file and direct output into the log.
  2. Set a break point at the instruction immediately after the branch at the bottom of the loop. Try to arrange your program so the loop has a distinct bottom.
  3. Set a watch on the count of the data values with no excess; be sure to count in a memory location, not in a register.
  4. Display the execution address of the memory locations holding the sum of the excesses, the count of the values with no excess, and the seventh data value (the 14).
  5. Step one instruction at a time until you go around the loop one time.
  6. Execute (NOT step) until the watch on the location stops the program. Then, display the sum of the excesses and the current data value as decimal numbers. The current data value is the one that caused the watch point to trigger; your program should have a register pointing at it - use the register to display the value.
  7. Cancel the watch and execute (NOT step) until the break point is reached.
  8. Step one instruction at a time until the $EXIT_S is reached.
  9. Display the sum of the excesses, the average excess, the count of the values with excess, and the count of the values with no excess as decimal values.
  10. Finish execution and exit to DCL level.

Hand in a printout on green-bar paper of the .LIS file and the debug log. On the log by hand, write the associated action numbers where appropriate.