New Reply

processor instruction prefixes (number of additional clock cycles)

 
Share Thread Thread Tools
Jul15-11, 08:52 PM   #1
 

processor instruction prefixes (number of additional clock cycles)


More specifically, this question is oriented towards the Intel 8086.

I have this manual that lists the number of clock cycles the 8086 requires to execute each of its instructions, prefixes, et cetera.

My question is about repeat string instructions. The REP prefix is listed as 2 clocks. MOVSx by itself is 18 clocks. REP MOVSx is 9 + (17 / number of repetitions).

If I wanted to count the number of clock cycles the 8086 would consume executing a REP MOVSx instruction in an instance of my code, would I include the REP prefix's 2 clocks for each repetition? Or, do I count it once, then add 9 + (17 / number of repetitions)? Or, does that 9 include the REP, meaning I should not count the prefix as consuming any clock cycles at all?

And what if I used a segment override with the REP MOVSx? Normally, I add 2 clocks for segment override. So +2 for each repetition? Just the first repetition?

Sorry. I know this is a very esoteric question. "Who cares about the 8086?" Right? I do, and I am curious about this unclear situation. So, if anyone happens to know, could they please enlighten me?



http://matthieu.benoit.free.fr/cross...ers_Manual.pdf
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> 'Whodunnit' of Irish potato famine solved
>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change
>> Curiosity Mars rover drills second rock target
Jul15-11, 08:59 PM   #2
 
Recognitions:
Homework Helper Homework Help
The prefix instructions only take the 2 extra cycles one time. Note that it takes 4 cycles to read memory (to fetch 16 bits of instruction data), so that 2 cycles may be 4 cycles depending on the instruction boundary, and if previous instructions were fast enough (2 to 3 cycles) to empty the pre-fetch queue. I don't know if the rep movs ... 9 cycles includes the rep overhead or not.
 
New Reply
Thread Tools


Similar Threads for: processor instruction prefixes (number of additional clock cycles)
Thread Forum Replies
Help with converting machine language instruction into MIPS assembly instruction Programming & Comp Sci 9
number of cycles in a graph ??? Programming & Comp Sci 0
Clock cycles per instruction? Computing & Technology 3
Cycles per instruction question, why different CPI when I change for loop order? Engineering, Comp Sci, & Technology Homework 13
Packet Transfer; Clock Cycles Computing & Technology 2