[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opcode Instruction Question



Bryan Parkoff wrote:

> 256 Opcodes vs 65536 Opcodes
> 
>     I do not talk about operand that can range from 8 bit through 32 bit
>     and
> beyond.  I only talk about the opcode.  Opcode is only 8 bit which 65xxx
> CPU
> can hold up to 256 opcodes.  My question is--how is it possible that
> another CPU such as Intel can hold more than 256 opcodes (perhaps 300
> opcodes).
>>256 opcodes use 16 bits because >256 opcodes uses two hex codes while <256
> opcodes use only one hex codes (8 bit).  Do you know what I am talking
> about?  Please advise.
> 


The 80x86, for example, (and even the Z80, I believe) can use an "opcode 
prefix" which changes the meaning of the next byte read as an opcode, thus 
giving an effectively larger variable-length instruction set.  It is 
important to note that on the Intel x86 (386 and above), the CISC 
instructions are broken down into smaller parts and run by microcode.  
Theoretically, Intel could create rather flexible, complex instructions, 
but in practice is not feasable.

Other processors (the 68000, for example) use a full 16 bits for the 
opcode, and fetch it as one piece.  What the person before you was saying 
is that since not all 16-bit combinations are used, some of them can be 
used to store all or part of an operand.

Hope this clears things up a little.

Mike