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.
- Set up a debug log file and direct output into the log.
- 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.
- 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.
- 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).
- Step one instruction at a time until you go around the loop
one time.
- 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.
- Cancel the watch and execute (NOT step) until the break point
is reached.
- Step one instruction at a time until the $EXIT_S is reached.
- 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.
- 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.