Question: Q 1 Why didn t this program run as entered? Why? What did you have to change to make it run? Note: This kind of

Q1 Why didnt this program run as entered? Why? What did you have to change to make it run? Note: This kind of mistake is very common when writing programs if you arent careful with the words you choose for labels.
Q2 Did you set a breakpoint and step through all 256 steps (from zero to 255)? After you get partway through the program with the breakpoint set on each loop, would it make sense to move the breakpoint to the ret instruction and just check the final result in EAX?
Q3 The EAX register is counting in hexadecimal, but the endnum is defined in decimal, to what value would you change it to make it hexadecimal? Try it to make sure your program still runs.
Q4 Make your counter count by two, instead of one. Does your program operate as expected (i.e., did you have any problem when it got to the end with the jump instruction you used?)?
Q5 Change your counter to count from zero to 100. What did you have to change?
Q6 Modify your program to count down from the 255 to zero. Make sure your program makes sense to someone else reading it, or you reading it a year from now (i.e., make sure the variable [data] names reflect the correct numbers); is it important to redefine the startnum and endnum, or just simply change their place in the program?
Q7 Modify your program to count down from 100 to zero. Was this as simple as it was to change the count up counter from 255 to 100?
Q8 Now that your counter is counting from 100 to zero, make it count from 100 to zero three times. Use another data segment value to specify the number of repetitions of the 100 to zero count.
Here are some hints:
a) This program will consist of two separate loops, one inside the other.
b) You should use the ECX register for the outer loop, typically ECX is used as a counter by convention.
c) If you start ECX at zero, your outer loop increment to two, which should be the value in the data segment (for three total loops).
d) If you choose to count down, you might set the data segment value to three, and check for JNE to loop as you decrement ECX.

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 Programming Questions!