Instruction Cycle of a 8086 statement

  • Follow


Hi all,

Is there a way of determining the Instruction Cycle Count of a
statement in 8086 processors?I don't want to calculate the exact time
of a statement, I only want to measure how many cycles will a
statement take?For example fetch an instruction is 2 cycles and for
example moving a register to memory is 4 cycles...etc.Are there some
constraint values on specific statements?

Regards...

0
Reply sumerc (48) 3/20/2007 10:57:29 AM

"k3xji" <sumerc@gmail.com> writes:

> Is there a way of determining the Instruction Cycle Count of a
> statement in 8086 processors?I don't want to calculate the exact time
> of a statement, I only want to measure how many cycles will a
> statement take?For example fetch an instruction is 2 cycles and for
> example moving a register to memory is 4 cycles...etc.Are there some
> constraint values on specific statements?

Intel publishes a set of processor manuals that can help you
figure out, to a first approximation, how much time an
instruction takes.
-- 
"Writing is easy.
 All you do is sit in front of a typewriter and open a vein."
--Walter Smith
0
Reply Ben 3/20/2007 2:06:23 PM


On Tue, 20 Mar 2007 09:06:23 -0500, Ben Pfaff wrote
(in article <87ejnk80ww.fsf@blp.benpfaff.org>):

> "k3xji" <sumerc@gmail.com> writes:
> 
>> Is there a way of determining the Instruction Cycle Count of a
>> statement in 8086 processors?I don't want to calculate the exact time
>> of a statement, I only want to measure how many cycles will a
>> statement take?For example fetch an instruction is 2 cycles and for
>> example moving a register to memory is 4 cycles...etc.Are there some
>> constraint values on specific statements?
> 
> Intel publishes a set of processor manuals that can help you
> figure out, to a first approximation, how much time an
> instruction takes.

One note though, that is still going to be an approximation if you are 
running a program on top of an operating system.  The only way that 
data will be useful for actual measurement instead of comparison is to 
run code standalone with nothing interrupting it.

-- 
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those 
 who have not got it."  - George Bernard Shaw





0
Reply Randy 3/20/2007 4:17:53 PM

k3xji wrote:

> Is there a way of determining the Instruction Cycle Count of a
> statement in 8086 processors?

Do yuu mean the 8086 processor specifically, or are you thinking of any
processor in that extended family (including modern P4s and so on) ?

I'm very much not an expert, but as I understand it , it is almost
possible, for the 808x processors (assuming there are no interrupts, of
course), where only diivision and multiplication took times dependent
on their argument values.  But as the 8086 processors morphed into the
IA32 family, and as that family grew more and more advanced, it becomes
less and less feasible to predict timings without knowing the exact
address sequences involved because of agressive cacheing, pipelining,
register aliasing, etc, etc.

FWIW, this page seems to have Intel's documentation on the i86
processors.  I have read none of it myself (and plan on keeping it that
way ;-)

	http://www.intel.com/design/intarch/intel186/docs_186.htm

    -- chris
0
Reply Chris 3/20/2007 5:47:42 PM

> Intel publishes a set of processor manuals that can help you
> figure out, to a first approximation, how much time an
> instruction takes.

I'm not sure it's still true, but it used to be that you could call
them and they'd send you a print copy.  3 or 4 very big books with
everything you've ever wanted to know about programming Intel
processors.

Michael

0
Reply Michael 3/20/2007 8:20:05 PM

"Michael" <mchlgibs@aol.com> writes:

>> Intel publishes a set of processor manuals that can help you
>> figure out, to a first approximation, how much time an
>> instruction takes.
>
> I'm not sure it's still true, but it used to be that you could call
> them and they'd send you a print copy.  3 or 4 very big books with
> everything you've ever wanted to know about programming Intel
> processors.

The print copies weren't available for a while, but are now back
in print.  I received a big box full of them sometime last year.

AMD does the same.
-- 
"A computer is a state machine.
 Threads are for people who cant [sic] program state machines."
--Alan Cox
0
Reply Ben 3/20/2007 8:28:39 PM

Chris Uppal wrote:
> k3xji wrote:
> 
>> Is there a way of determining the Instruction Cycle Count of a
>> statement in 8086 processors?
> 
> Do yuu mean the 8086 processor specifically, or are you thinking
> of any processor in that extended family (including modern P4s
> and so on) ?

On the pentium up there is an instruction that reads clock cycles,
something like rtdsc.

-- 
Chuck F (cbfalconer at maineline dot net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>



-- 
Posted via a free Usenet account from http://www.teranews.com

0
Reply CBFalconer 3/21/2007 12:17:30 AM

On Tue, 20 Mar 2007 19:17:30 -0500, CBFalconer wrote
(in article <4600799A.186DD11F@yahoo.com>):

> Chris Uppal wrote:
>> k3xji wrote:
>> 
>>> Is there a way of determining the Instruction Cycle Count of a
>>> statement in 8086 processors?
>> 
>> Do yuu mean the 8086 processor specifically, or are you thinking
>> of any processor in that extended family (including modern P4s
>> and so on) ?
> 
> On the pentium up there is an instruction that reads clock cycles,
> something like rtdsc.

It's fraught with potential errors though on SMP systems, as there is 
no guarantee they'll be sync'd between the processors, so you may get 
completely bogus or inaccurate results if your process gets bounced 
from one CPU to another between calls.


-- 
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those 
 who have not got it."  - George Bernard Shaw





0
Reply Randy 3/21/2007 2:45:58 AM

7 Replies
437 Views

(page loaded in 0.126 seconds)

Similiar Articles:













7/23/2012 12:17:02 PM


Reply: