Paul K.
Paul K.

Reputation: 196

Machine cycles in x86 CPU after assembly instruction

Theoretically I have Intel 8086 and I want to run this instruction:

add [2000], 6 (or in AT&T syntax: addw $6, 2000)

I also know that:

Now I want to describe machine cycle in this CPU: fetch & execute.

I know how it looks in theory:

Fetch:

Execute:

But I don't know how it looks with real CPU registers and assembly code. Can you explain this?

Upvotes: 0

Views: 544

Answers (1)

rcgldr
rcgldr

Reputation: 28921

The values in memory or registers don't matter. When

        add     word ptr ds:[02000h],00006h

is executed, the cpu reads 16 bit value 2 from location 2000 into an internal (unnamed) register, adds 6 to the 2, and stores and stores 16 bit value 8 into location 2000 (little endian format). At least two web sites shows this as taking 23 cycles (17 for instruction + 6 for the effective addressing).

Upvotes: 2

Related Questions