You are on page 1of 4

11/4/21, 1:41 AM Opcode - Wikipedia

Opcode
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 language instruction 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.

Contents
Overview
Operands
Software instruction sets
See also
References
Further reading

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.

Operands

Depending on architecture, the operands may be register values, values in the stack, other
memory values, I/O ports (which may also be memory mapped), etc., specified and accessed using
more or less complex addressing modes. The types of operations include arithmetic, data copying,
logical operations, and program control, as well as special instructions (such as CPUID and
others).[10]

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

https://en.wikipedia.org/wiki/Opcode 1/4
11/4/21, 1:41 AM Opcode - Wikipedia

high-level programming languages,[12] which are typically easier to read 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]

See also
Gadget (machine instruction sequence)
Illegal opcode
Opcode database
Syllable (computing)

References
1. Barron, David William (1978) [1971, 1969]. "2.1. Symbolic instructions". Written at University of
Southampton, Southampton, UK. In Floretin, J. John (ed.). Assemblers and Loaders.
Computer Monographs (3 ed.). New York, USA: Elsevier North-Holland Inc. p. 7. ISBN 0-444-
19462-2. LCCN 78-19961 (https://lccn.loc.gov/78-19961). (xii+100 pages)
2. Chiba, Shigeru (2007) [1999]. "Javassist, a Java-bytecode translator toolkit" (http://www.docjar.
org/html/api/javassist/bytecode/InstructionPrinter.java.html). Archived (https://web.archive.org/
web/20200302185725/http://www.docjar.org/html/api/javassist/bytecode/InstructionPrinter.java.
html) from the original on 2020-03-02. Retrieved 2016-05-27.
3. "Appendix B - Instruction Machine Codes" (http://bitsavers.trailing-edge.com/components/intel/
MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf) (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 (https://web.archive.org/web/20200
301235541/http://bitsavers.trailing-edge.com/components/intel/MCS4/MCS-4_Assembly_Lang
uage_Programming_Manual_Dec73.pdf) (PDF) from the original on 2020-03-01. Retrieved
2020-03-02.
4. Raphael, Howard A., ed. (November 1974). "The Functions Of A Computer: Instruction
Register And Decoder" (http://bitsavers.trailing-edge.com/components/intel/MCS40/MCS-40_U
sers_Manual_Nov74.pdf) (PDF). MCS-40 User's Manual For Logic Designers. Santa Clara,
California, USA: Intel Corporation. p. viii. Archived (https://web.archive.org/web/202003030242
44/http://bitsavers.trailing-edge.com/components/intel/MCS40/MCS-40_Users_Manual_Nov7
4.pdf) (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. […]"
5. Jones, Douglas W. (June 1988). "A Minimal CISC". ACM SIGARCH Computer Architecture
News. New York, USA: Association for Computing Machinery (ACM). 16 (3): 56–63.
doi:10.1145/48675.48684 (https://doi.org/10.1145%2F48675.48684). S2CID 17280173 (https://
api.semanticscholar.org/CorpusID:17280173).

https://en.wikipedia.org/wiki/Opcode 2/4
11/4/21, 1:41 AM Opcode - Wikipedia

6. Domagała, Łukasz (2012). "7.1.4. Benchmark suite" (https://books.google.com/books?id=e6ap


NOED26kC). Application of CLP to instruction modulo scheduling for VLIW processors (https://
books.google.com/books?id=e6apNOED26kC). Gliwice, Poland: Jacek Skalmierski Computer
Studio. pp. 80–83 [83]. ISBN 978-83-62652-42-6. Archived (https://web.archive.org/web/20200
302192452/https://books.google.de/books?hl=de&id=e6apNOED26kC&jtp=83) from the
original on 2020-03-02. Retrieved 2016-05-28.
7. Smotherman, Mark (2016) [2013]. "Multiple Instruction Issue" (https://people.cs.clemson.edu/~
mark/330/ilp.txt). School of Computing, Clemson University. Archived (https://web.archive.org/
web/20160528142545/https://people.cs.clemson.edu/~mark/330/ilp.txt) from the original on
2016-05-28. Retrieved 2016-05-28.
8. Jones, Douglas W. (2016) [2012]. "A Minimal CISC" (http://homepage.cs.uiowa.edu/~jones/arc
h/cisc/). Computer Architecture On-Line Collection. Iowa City, USA: The University of Iowa,
Department of Computer Science. Archived (https://web.archive.org/web/20200302190911/htt
p://homepage.cs.uiowa.edu/~jones/arch/cisc/) from the original on 2020-03-02. Retrieved
2016-05-28.
9. Schulman, Andrew (2005-07-01). "Finding Binary Clones with Opstrings & Function Digests" (h
ttp://www.drdobbs.com/finding-binary-clones-with-opstrings-fu/184406152). Dr. Dobb's Journal.
Part I. Vol. 30 no. 7. CMP Media LLC. pp. 69–73. ISSN 1044-789X (https://www.worldcat.org/is
sn/1044-789X). #374. Archived (https://web.archive.org/web/20200302175401/https://www.drd
obbs.com/finding-binary-clones-with-opstrings-fu/184406152) from the original on 2020-03-02.
Retrieved 2020-03-02; Schulman, Andrew (2005-08-01). "Finding Binary Clones with
Opstrings & Function Digests" (http://www.drdobbs.com/finding-binary-clones-with-opstrings-f
u/184406203). Dr. Dobb's Journal. Part II. Vol. 30 no. 8. CMP Media LLC. pp. 56–61.
ISSN 1044-789X (https://www.worldcat.org/issn/1044-789X). #375. Archived (https://web.archi
ve.org/web/20200302185255/https://www.drdobbs.com/finding-binary-clones-with-opstrings-fu/
184406203) from the original on 2020-03-02. Retrieved 2016-05-28; Schulman, Andrew (2005-
09-01). "Finding Binary Clones with Opstrings & Function Digests" (http://www.drdobbs.com/to
ols/finding-binary-clones-with-opstrings-fu/184406247). CMP Media LLC. Part III. Vol. 30 no. 9.
United Business Media. pp. 64–70. ISSN 1044-789X (https://www.worldcat.org/issn/1044-789
X). #376. Archived (https://web.archive.org/web/20200302185646/https://www.drdobbs.com/to
ols/finding-binary-clones-with-opstrings-fu/184406247?pgno=3) from the original on 2020-03-
02. Retrieved 2016-05-28.
10. Hennessy, John L.; Patterson, David A.; Asanović, Krste; Bakos, Jason D.; Colwell, Robert P.;
Bhattacharjee, Abhishek; Conte, Thomas M.; Duato, José; Franklin, Diana; Goldberg, David;
Jouppi, Norman P.; Li, Sheng; Muralimanohar, Naveen; Peterson, Gregory D.; Pinkston,
Timothy M.; Ranganathan, Parthasarathy; Wood, David A.; Young, Cliff; Zaky, Amr (2017-11-
23). Computer architecture: A quantitative approach (6 ed.). Cambridge, Massachusetts, USA:
Morgan Kaufmann Publishers. ISBN 978-0-12811905-1. OCLC 983459758 (https://www.world
cat.org/oclc/983459758).
11. Mansfield, Richard (1983). "Introduction: Why Machine Language?" (http://www.atariarchives.o
rg/mlb/introduction.php). Machine Language For Beginners (https://www.atariarchives.org/mlb/i
ndex.php). Compute! Books (1 ed.). Greensboro, North Carolina, USA: COMPUTE!
Publications, Inc., American Broadcasting Companies, Inc.; Small System Services, Inc.
ISBN 0-942386-11-6. Archived (https://web.archive.org/web/20080213090055/http://www.atari
archives.org/mlb/introduction.php) from the original on 2008-02-13. Retrieved 2016-05-28.
12. "Programming Language Popularity" (https://web.archive.org/web/20150411135441/http://lang
pop.com/). langpop.com. 2013-10-25. Archived from the original (http://langpop.com/) on
2015-04-11. Retrieved 2015-10-10.
13. Swanson, William (2001). "Introduction to Assembly Language" (http://www.swansontec.com/s
program.htm). Swanson Technologies. Archived (https://web.archive.org/web/2020030218584
0/https://www.swansontec.com/sprogram.html) from the original on 2020-03-02. Retrieved
2015-10-10.
14. "bytecode Definition" (https://web.archive.org/web/20121006015213/http://www.pcmag.com/en
cyclopedia_term/0%2C2542%2Ct%3Dbytecode%26i%3D39108%2C00.asp). PC Magazine.
PC Magazine Encyclopedia. Archived from the original (https://www.pcmag.com/encyclopedia
_term/0,2542,t=bytecode&i=39108,00.asp) on 2012-10-06. Retrieved 2015-10-10.
https://en.wikipedia.org/wiki/Opcode 3/4
11/4/21, 1:41 AM Opcode - Wikipedia

Further reading
Hyde, Randall (2004). Write Great Code: Thinking Low-level, Writing High-level (https://books.
google.com/books?isbn=1593270658). Understanding the Machine. 1. San Francisco,
California, USA: No Starch Press. p. passim. ISBN 1-59327003-8. Retrieved 2015-10-10.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Opcode&oldid=1048278636"

This page was last edited on 5 October 2021, at 04:54 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License;


additional terms may apply. By using
this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia
Foundation, Inc., a non-profit organization.

https://en.wikipedia.org/wiki/Opcode 4/4

You might also like