Question

Counters must have a separate input or instruction to reset. How would you assure that all...

Counters must have a separate input or instruction to reset. How would you assure that all counters are reset and their accumulators show 0 when you start a process?

Homework Answers

Answer #1

In the begining of process you can add a routine which checks if the values of counters you want to use are zero. if ther are not then add a reset instruction. Also save the counter value to some other variable/register before setting it zero as other process might be using them. Follwing is the pseudo code of the routine to make sure counters are zero.

counter_check()
{

If counter_value is 0:
continue;
else:
counter_old = counter_value;
counter_value = 0;

}

Make a routine to set back the old value of counter

counter_setback()
{
counter_value = counter_old;
}

You can call this routine at the beginin of your process

process()
{
counter_check()
........
........
........
counter_setback()
}

I hope you get the idea. You can easily convert the pseudo code in assembly language by using conditional jumps,call, MOV and reset instructions wherever required.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What would happen with the ring counter if the reset switch set the value of the...
What would happen with the ring counter if the reset switch set the value of the counter to a ‘3’ instead of a ‘1’? Group of answer choices There would be a false output, but the counter would continue to run in the proper order after the “3” state The counter will count in the sequence: 3 -> 6 -> 5 -> 3 -> 6 -> ... which means two “on” outputs will be shifted left. The “3” state was...
How would you separate (+)-or (-) - tartaric acid from meso-tartaric acid? How would you separate...
How would you separate (+)-or (-) - tartaric acid from meso-tartaric acid? How would you separate (+)-or (-) - tartaric acid?
How would you evaluate a patient’s ability to understand your instruction and their current knowledge base...
How would you evaluate a patient’s ability to understand your instruction and their current knowledge base about their problem? What characteristics of the patient would be helpful? How would you be certain that the patient understands your medication instruction? What methods of therapeutic communication would be useful in advanced practice?
List at least 3 examples of how you would divide students into groups for instruction.
List at least 3 examples of how you would divide students into groups for instruction.
How would you separate ag from hg
How would you separate ag from hg
Suppose you need to prepare 1.0 L of Stock solution which must have a concentration of...
Suppose you need to prepare 1.0 L of Stock solution which must have a concentration of 150 mg N/L. You start with solid Potassium Nitrate, KNO3 . A. How many moles of Nitrogen should 1.0 L of Stock solution contain? B. How many moles of KNO3 should 1.0 L of stock solution contain? C. Please show working. How many grams of KNO3 will you have to weigh out to prepare 1.0 L of stock solution? (Show ALL work!) (Reminder: the...
Problems: 1-How many nodes would you expect to find when n=3? Where would you expect the...
Problems: 1-How many nodes would you expect to find when n=3? Where would you expect the maxima to be (psi)? 2- What is the minimum n value where you could start finding (psi) with a value < 0? 3-What is the minimum n value where you could start finding (psi)^2 with a value < 0?
Propose in detail how would you separate and purify a mixture of acetone and toluene. Give...
Propose in detail how would you separate and purify a mixture of acetone and toluene. Give detailed descriptions.
Write a program that takes in an integer in the range 20-98 as input. The output...
Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. I already did the coding part:num = int(input()) if 20 <= num <= 98: while num % 11!=0: print(num) num -= 1 print(num) else: print('Input must be 20-98') Question: How do you know when to use %? Why is it %11 and why not %12 or %15? How do...
13. (True/False): The register list in the USES directive must use commas to separate the register...
13. (True/False): The register list in the USES directive must use commas to separate the register names. 11. (True/False): The USES operator lets you name all registers that are modified within a procedure. 2. Which instruction pushes the 32-bit EFLAGS register on the stack? 18. Which statement is true about what will happen when the example code runs? 1: main PROC 2: mov eax,40 3: push offset Here 4: jmp Ex4Sub 5: Here: 6: mov eax,30 7: INVOKE ExitProcess,0 8:...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT