answersLogoWhite

0


Best Answer

To find out the time interval between two consecutive events using the 8086, or any other processor or programming language for that matter, you observe some time reference when you see the two events, and you subtract the time references from each other to calculate elapsed time.

Unfortunately, the 8086 does not have an interval timer, so you either have to program one using some kind of periodic clock, or you have to measure time using a hard coded loop.

Method One: Interrupts for both

The periodic clock, for instance running at 1 kHz, generates a 1 mS interrupt. In the interrupt service routine, you increment a variable that represents time in mS. The monitored event also generates an interrupt. On the first interrupt, you note the interval time so far. On the second interrupt, you note and compute the time difference. In this example, you have a resolution of 1 mS.

If you were to use an original IBM PC, you would have a clock interrupt available with a frequency of 55 Hz, giving you a resolution of about 18.2 mS.

Method Two: Interrupts for one

The periodic clock runs as an interrupt, as described before. In a loop, you monitor the event, noting the interval time between susequent events, and calculate the time difference. The loop consumes all CPU time while running, which might be a problem.

Method Three: External clock

You have an external counter, perhaps running at 1 mHz. Either hard coded or in an interrupt service routine, you monitor the event, read the clock twice, and calculate the time. In this example, you have a resolution of 1 uS.

Method Four: Brute force

You have a loop that counts iterations in some variable, noting how many iterations there are between events.

While this method requires the least amount of hardware, it is the poorest method, both from the standpoint of overall system threading, and from the standpoint of accuracy.

The loop consumes all processing time. You cannot do anything else during that time, otherwise the results will be wrong. If you are designing a system with multiple processes and threads, this will not work.

The loop also does not have an easily predictable period. Memory latency, cache hit/miss ratio, and other ongoing interrupts will disturb the results. In a single threaded system, and that includes whatever operating system you use, it can work, and it can have repeatable results - and you will need to spend some time calibrating it.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program to find out the time interval between two consecutive events using 8086 programming language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the definition of a contour interval?

The definition of a contour interval is the difference in elevation between two consecutive lines.


Is XML a programming language?

It is programming languages that are referred to in terms of "high level" and "low level".Extensible Markup Language(XML) is a markup language not a programming language, it is a data formatting specification that makes the presentation of data independent of programs (so that data can be passed between programs).For this reason the answer to your question is "neither".


What is the comparative between Objective Oriented Programming Language and Structured Programming Language?

what is triple jump test?


Short note on structural programming and procedural programming?

There is no difference between procedural programing language & structure programing language.


What is the difference between oriented programming language and high programming language?

Set/subset: Some high level programming languages are object oriented, but not all of them.


The interval of a graph is the difference between any two numbers on the scale?

Yes, the interval of a graph is the difference between any two consecutive numbers on a scale.For example, if the scale read: 2,4,6,8,10 then you could do 4-2, 6-4, etc. to find the interval. (which is 2)


What is the difference between static and dynamic programming?

in static programming properties, methods and object have to be declared first, while in dynamic programming they can be created at runtime. This is usually due to the fact that the dynamic programming language is an interpreted language.


What is the difference between program language and procedural language?

programming language is of two type 1. procedural programming language 2.non procrdural programming language .. ----non procedural programming language means that which relates with the real world.. for example-oops oops is a non procedural programming language because it relates to the object and object relate to the natural or real world where as that languge which does not belong to the real world is known as procedural language


What two consecutive whole numbers falls between 77?

Nothing can fall "between 77". 77 is one number; you need an interval for any numbers to fall BETWEEN.


What is the difference between aspnet vbnet and c?

asp.net is website programming vb.net is windows forms programming the visual basic language c#.net is windows forms programming in c# language


Difference between highlevel programming language and low level programming language and middle level programming language?

High level programming is drag & drop, easy peasy programming. In the objects you use to create something ( program, graphics). The components are made up of middle level programming. A language that is easier to remember than zeros & one's...which is a low-level language that integrated chips use to work.


Difference between C and C programming language?

The C and C programming languages are one and the same. There is no difference between those languages.