View Single Post
  #10  
Old February 21st 14, 06:23 AM posted to comp.sys.intel,comp.sys.ibm.pc.hardware.chips,alt.windows7.general
Gene E. Bloch[_4_]
external usenet poster
 
Posts: 32
Default How many x86 instructions?

On 2/20/2014, Paul posted:
Yousuf Khan wrote:
On 20/02/2014 8:19 PM, Gene E. Bloch wrote:
Looking briefly at http://ref.x86asm.net/ and
http://www.sandpile.org/
gives me the impression that the *isn't* a simple count of
instructions.


Yeah, I looked at some of those sites already, and that was my
impression too, that the instructions aren't easy to count. It
doesn't help that Intel and AMD have their own extensions, either.

But it goes to show why the age of compilers is well and truly upon
us, there's no human way to keep track of these machine language
instructions. Compilers just use a subset, and just repeat those
instructions over and over again.

Yousuf Khan


Actually, even the compiler writers are getting
tired of the expanding instruction set. (I read
a rant on the topic.) Intel can make new instructions
faster than those guys can find a use for them.


At one time, a compiler would issue instructions
from about 30% of the instruction set. It would mean
a compiled program would never emit the other 70% of
them. But a person writing assembler code, would
have access to all of them, at least, as long as
the mnemonic existed in the assembler.


And was somehow accessible to the mind of the programmer :-)

I worked on a couple of 8 bit micros, and at the
time, you could get a fold-out card (about a foot long,
double sided), with all the instructions on it. And
that's what we'd use as a quick reference when picking
instructions. You can't do that now, because the
fold-out card would be a hundred feet long. It
was a sign you were a "real programmer", when the
local rep gave you your fold-out card :-) LOL.


Paul


In my assembly language days, the fold-out card was pretty damn small
:-)

I remember writing some code to move a block of memory in 286 (I think)
days, and later I realized how badly I had set it up. I didn't take
proper advantage of the way the 20-bit addressing worked[1], so I made
the call unusual and the code klutzy. I required the caller to address
memory to the byte level, i.e., all 20 bits, instead of to the
high-order 16 bits. Flexible but silly.

[1] Because I didn't fully understand the usage conventions yet.

--
Gene E. Bloch (Stumbling Bloch)