All Topics  
Opcode

 

   Email Print
   Bookmark   Link






 

Opcode



 
 
In computer technology, an opcode (operation code) is the portion of a machine language instruction
Instruction (computer science)

In computer science, an instruction is a single operation of a central processing unit defined by an instruction set architecture. In a broader sense, an "instruction" may be any representation of an element of an executable program, such as a bytecode....
 that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in question (which may be a general CPU
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 or a more specialized processing unit). Apart from the opcode itself, an instruction normally also has one or more specifiers for operand
Operand

An operand is one of the inputs of an operator in mathematics. The following arithmetic expression shows an example of operators and operands:...
s (i.e.






Discussion
Ask a question about 'Opcode'
Start a new discussion about 'Opcode'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computer technology, an opcode (operation code) is the portion of a machine language instruction
Instruction (computer science)

In computer science, an instruction is a single operation of a central processing unit defined by an instruction set architecture. In a broader sense, an "instruction" may be any representation of an element of an executable program, such as a bytecode....
 that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in question (which may be a general CPU
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 or a more specialized processing unit). Apart from the opcode itself, an instruction normally also has one or more specifiers for operand
Operand

An operand is one of the inputs of an operator in mathematics. The following arithmetic expression shows an example of operators and operands:...
s (i.e. data) on which the operation should act, although some operations may have implicit operands, or none at all. There are instruction sets with nearly uniform fields for opcode and operand specifiers, as well as others (the x86 architecture for instance) with a more complicated, varied length structure.

Depending on architecture, the operand
Operand

An operand is one of the inputs of an operator in mathematics. The following arithmetic expression shows an example of operators and operands:...
s
may be register
Processor register

In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere....
 values, values in the stack
Call stack

In computer science, a call stack is a dynamic Stack data structure that stores information about the active subroutines of a computer program....
, other memory
Memory

In psychology, memory is an organism's mental ability to store, retain and recall information. Traditional studies of memory began in the fields of philosophy, including techniques of mnemonic....
 values, I/O
I/O

I/O may refer to:* Input/output, a system of communication for information processing systems* The input-output model, an economic model of flow prediction between sectors...
 ports, etc, specified and accessed using more or less complex addressing mode
Addressing mode

Addressing modes are an aspect of the instruction set architecture in most central processing unit designs. The various addressing modes that are defined in a given instruction set architecture define how Machine code Instruction in that architecture identify the operand of each instruction....
s. The types of operations include arithmetic
Arithmetic

Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations....
s, data copying, logical operations, and program control, as well as special instructions (such as CPUID
CPUID

The CPUID opcode is a processor supplementary instruction for the x86 architecture. It was introduced by Intel in the early 1990s for later steppings of the Intel 80486 chip, and fully rolled out at the introduction of the Pentium MMX processor....
 and others).

Assembly

Assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
, or just assembly, is a low-level programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
, which uses mnemonic
Mnemonic

A mnemonic device is a memory aid. Commonly met mnemonics are often verbal, something such as a very short poem or a special word used to help a person remember something, particularly lists, but may be visual, kinesthetic or auditory....
s, instructions and operands to represent machine code. This enhances the readability while still giving precise control over the machine instructions. Most programming is done using high-level languages, which are much easier to write, to perform larger tasks. These languages need to be compiled, to translate into machine language, or run through other programs compiled in machine language.

Software instruction sets

Opcodes can also be found in so called byte codes and other representations intended for a software interpreter rather than a hardware device. These software based instruction sets often employ slightly higher-level data types and operations than most hardware counterparts, but are nevertheless constructed along similar lines. Examples include the Java programming language
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
's Java Virtual Machine
Java Virtual Machine

A Java Virtual Machine is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and Scripting language....
 (JVM), the byte code used in GNU Emacs for compiled LISP
Lisp

A lisp is a speech impediment, historically also known as sigmatism. Stereotypically, people with a lisp are unable to pronounce sibilants , and replace them with Interdental consonants , though there are actually several kinds of lisps....
 code, and many others.

See also

  • Illegal opcode
    Illegal opcode

    An Illegal Opcode, also called an Undocumented Instruction, is an instruction to a CPU that is not mentioned in any official documentation released by the CPU's designer or manufacturer, which nevertheless has an effect....
  • Opcode Systems
    Opcode Systems

    Opcode Systems, Inc. was founded in 1985 by Dave Oppenheim and based in and around Palo Alto, California, USA. Opcode produced MIDI sequencing software for the Mac OS and Microsoft Windows, which would later include digital audio capabilities, as well as audio and MIDI hardware interfaces....
    , a company that produced MIDI sequencing software with digital audio
    Digital audio

    Digital audio uses digital signals for sound reproduction. This includes Analog-to-digital converter, Digital-to-analog converter, storage, and transmission....
     capabilities for the Mac OS
    Mac OS

    Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems....
     and Microsoft Windows
    Microsoft Windows

    Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
    , as well as audio and MIDI hardware interfaces