Does using an Intel register for its “intended purpose” increase efficiency?

No, not really anymore -- or at least not very often anyway. Using ECX as a counter lets you use the LOOP instruction. At one time, that was a significant advantage, but on most recent CPUs, a LOOP takes longer to execute than the combination of DEC ECX/JNZ wherever.

The possible advantage is that it reduces memory bandwidth usage, which is a bottleneck more and more often. It can also be an advantage when/if you can use the other forms like LOOPNZ, which can be relatively complex to simulate with separate instructions.

Up vote 3 down vote favorite 1 share g+ share fb share tw.

This article claims that each register has an intended purpose and more importantly, When the engineers at Intel designed the original 8086 processor, they had a special purpose in mind for each register. As they designed the instruction set, they created many optimizations and special instructions based on the function they expected each register to perform. Using registers according to Intel's original plan allows the code to take full advantage of these optimizations.

Unfortunately, this seems to be a lost art. Few coders are aware of Intel's overall design, and most compilers are too the simplistic or focused on execution speed to use the registers properly. Understanding how the registers and instruction set fit together, however, is an important step on the road to effortless size-coding.

Are there any other sources to corroborate this article? If so, I'd really like to check it out. Please note I'm not talking about situations where fast operations like STOS uses edi - I'm just wondering if there is any performance degradation if I use eax and esi as counters instead of ecx or is it just about readability?

Assembly intel link|improve this question edited Dec 14 '09 at 19:58 asked Dec 14 '09 at 19:47Jacob15.9k22061 94% accept rate.

There are instructions in the instruction set which use specific registers, which are smaller (and often faster) than the equivalent functions which target any register.

1 Most notably references to AX vs. others. – Brian Knoblauch Dec 14 '09 at 20:05.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions