In
computing, an opcode[1][2] (abbreviated from operation code,[1] also known as instruction machine code,[3]instruction code,[4]instruction syllable,[5][6][7][8]instruction parcel or opstring[9][2]) is the portion of a
machine languageinstruction that specifies the operation to be performed. Beside the opcode itself, most instructions also specify the data they will process, in the form of
operands. In addition to opcodes used in the
instruction set architectures of various
CPUs, which are hardware devices, they can also be used in
abstract computing machines as part of their
byte code specifications.
Overview
Specifications and format of the opcodes are laid out in the instruction set architecture (
ISA) of the processor in question, which may be a general
CPU or a more specialized processing unit.[10] Opcodes for a given instruction set can be described through the use of an
opcode table detailing all possible opcodes. Apart from the opcode itself, an instruction normally also has one or more specifiers for
operands (i.e. data) on which the operation should act, although some operations may have implicit operands, or none at all.[10] 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, variable-length structure.[10][11] Instruction sets can be extended through the use of
opcode prefixes which add a subset of new instructions made up of existing opcodes following reserved byte sequences.[citation needed]
Assembly language, or just assembly, is a
low-level programming language, which uses
mnemonic instructions and operands to represent
machine code.[10] This enhances the readability while still giving precise control over the machine instructions. Most programming is currently done using
high-level programming languages,[12] which are typically easier for humans to understand and write.[10] These languages need to be compiled (translated into assembly language) by a
system-specific
compiler, or run through other compiled programs.[13]
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 byte code found in
Java class files which are then interpreted by the
Java Virtual Machine (JVM), the byte code used in
GNU Emacs for compiled
Lisp code, .NET
Common Intermediate Language (CIL), and many others.[14]
^"Appendix B - Instruction Machine Codes"(PDF). MCS-4 Assembly Language Programming Manual - The INTELLEC 4 Microcomputer System Programming Manual (Preliminary ed.). Santa Clara, California, USA:
Intel Corporation. December 1973. pp. B-1–B-8. MCS-030-1273-1.
Archived(PDF) from the original on 2020-03-01. Retrieved 2020-03-02.
^Raphael, Howard A., ed. (November 1974).
"The Functions Of A Computer: Instruction Register And Decoder"(PDF). MCS-40 User's Manual For Logic Designers. Santa Clara, California, USA:
Intel Corporation. p. viii.
Archived(PDF) from the original on 2020-03-03. Retrieved 2020-03-03. […] Each operation that the processor can perform is identified by a unique binary number known as an instruction code. […]
^Smotherman, Mark (2016) [2013].
"Multiple Instruction Issue". School of Computing, Clemson University.
Archived from the original on 2016-05-28. Retrieved 2016-05-28.
^Jones, Douglas W. (2016) [2012].
"A Minimal CISC". Computer Architecture On-Line Collection. Iowa City, USA:
The University of Iowa, Department of Computer Science.
Archived from the original on 2020-03-02. Retrieved 2016-05-28.