Question: Write an assembly program that takes two labeled variables as input and computes one as output. Compute the total of all integers between x and

Write an assembly program that takes two labeled variables as input and computes one as output. Compute the total of all integers between x and y. Store the total in z. For example, if x=10 and y=17 then compute z=10+11+12+13+14+15+16+17. You may assume x < y. Your program must have the following three labels defined. The values can be changed. The code should work with any values of x and y that do not cause overflow in z. Your code will not be tested with values that would cause overflow. You may ingore that case and assume overflow will not happen for this question.

You code should have the following memory locations defined.

x: DB 10 y: DB 17 z: DB 0 ;Should be 10+11+...+16+17

Please use x86 Assembly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!