Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Effective Address calculation time on 8086/8088 [old school]

Matthieu_W_
Beginner
1,253 Views

I've started to implement a 8086/8088 with the goal of being cycle-exact. I can understand the reasoning behind the number of clock cycles for most instructions, however I must say I'm quite puzzled by the Effective Address (EA) calculation time.

More specifically, why does computing BP + DI or BX + SI take 7 cycles, but computing BP + SI or BX + DI take 8 cycles?

I could just wait for a given number of cycles, but I'm really interested in knowing why there's this 1-cycle difference (and overall why it takes so many cycles to do any EA calculation, since EA uses the ALU for computing addresses, and an ADD between registers is just 3 cycles).

The designers of the chip probably are retired by now, but hopefully there is somebody at Intel who has the knowledge, or can point me to the people who have it :-)

0 Kudos
4 Replies
zalia64
New Contributor I
1,253 Views

I suggest you check out the encoding of the instructions. Each additional byte means an additional cycle.

 

0 Kudos
Matthieu_W_
Beginner
1,253 Views

I have, there is the same number of bytes in the instruction, whether it's for example BX (5 cycles) or BX + SI (7 cycles) or BX + DI (8 cycles), all of it is encoded using the "mod" + "r/m" fields.

0 Kudos
SergeyKostrov
Valued Contributor II
1,253 Views
>>...More specifically, why does computing BP + DI or BX + SI take 7 cycles, but computing BP + SI or BX + DI take 8 cycles? Q1. Are you absolutely confident that your measurements are correct? Q2. How did you get these numbers? ( I mean 7 and 8 cycles )
0 Kudos
Matthieu_W_
Beginner
1,253 Views

Q1 + Q2. These are not measurements, these numbers come from Intel's own reference manual :-)

I have had the answer since then, the difference has to do with how the effective addressing was implemented with the microcode. So effectively, some modes (such as BP + DI) were more optimized than others (like BX + SI).

0 Kudos
Reply