Question: USING DOSBOX : PART II CREATE CODE AND CALCULATE THE AMOUNT OF TIME IT WILL TAKE TO RUN Use the enter command in debug to

USING DOSBOX : PART II CREATE CODE AND CALCULATE THE AMOUNT OF TIME IT WILL TAKE TO RUN
Use the enter command in debug to enter the following array of bytes 0A,04,13,07,0B,06,02,08,19,03
Starting at offset 1000 of the default data segment (therefore 0A goes into 1000 up to 03 into 1009)
Using the MOV, ADD and JMP instructions create a short program that adds (sums) the 10 numbers and saves the summed result (of 5f based on the above numbers) into offset 100A of the same segment (note that the running total result must be saved from inside the loop). Since this uses an unconditional jump the program would overwrite the result memory if you step through the loop more than 10(decimal) times (it is an infinite loop for this exercise, but only the time it takes to add up the array of 10 numbers is what we are trying to calculate)
Calculate the total time (number of clock cycles based on the 8086 processor), the program will take to run using the instruction timing data sheets. The way to calculate is to add the timing for one pass, then multiply by the number of passes it takes to complete the summation of the 10 values stored in the 10 locations).
Write out your program and give the number of clock cycles for each instruction (next to the instruction) then add up the total time for one loop pass at the bottom. Then assuming 0.5ns per clock cycle(this would be a 2Ghz processor) calculate the total execution time (of 10 loops (or less)) to sum the data(write that as a separate result from the total number of clock cycles (basically 0.5ns** total clock cycles is the total execution time in this problem)
Calculation summary steps:
Calculate instruction clock cycle time of initialization steps once this includes clearing the summation register or memory before 1st use.
Calculate the loop clock cycles (after the initialization down to and including the jmp) time, (multiply this number times the number of full loop passes to add the 10 numbers). Note that the loop can not sum more than it can read from ONE instruction per loop cycle (e.g. you can't place 10 reads and sums back to back so it finishes in one loop pass)
The last loop pass time doesn't have the final increments and jump (just the final add step to add the last number). Therefore, the main body of the loop(which reads the new number, adds it to the old sum, then stores the new sum) will execute once more than these last instructions(inc and jmp), so multiply the last instruction times one less the main body of the loop.
Use the below instructions with any of the available memory modes immediate, direct, register indirect etc. (note, depending on how you code it you can have a wide range of timing results). But remember the object of assembly language is to minimize the number of clock cycles it takes to calculate a given problem.
Mov
Add
Inc
Jmp
Note that the above instruction names do not represent a template for the actual program you will create, just the instruction names that are needed to complete the exercise (e.g. there may be several moves needed in your program).
Note that the jmp goes back to the offset of the instructions that follow the initialization steps (i.e. initialization for any registers used inside of the loop)
 USING DOSBOX : PART II CREATE CODE AND CALCULATE THE AMOUNT

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!