Machine code |
---|
General concepts |
Instructions |
In computing, an opcode (abbreviated from operation code) is an enumerated value that specifies the operation to be performed. Opcodes are employed in hardware devices such as arithmetic logic units (ALUs) and central processing units (CPUs) as well as in some software instruction sets. In ALUs the opcode is directly applied to circuitry via an input signal bus, whereas in CPUs, the opcode is the portion of a machine language instruction that specifies the operation to be performed.
CPUs
Opcodes are found in the machine language instructions of CPUs as well as in some abstract computing machines. In CPUs, an opcode may be referred to as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring. For any particular processor (which may be a general CPU or a more specialized processing unit), the opcodes are defined by the processor's instruction set architecture (ISA), and can be described by means of an opcode table. The types of operations may include arithmetic, data copying, logical operations, and program control, as well as special instructions (e.g., CPUID).
In addition to the opcode, many instructions also specify the data (known as operands) the operation will act upon, although some instructions may have implicit operands or none at all. Some instruction sets have nearly uniform fields for opcode and operand specifiers, whereas others (e.g., x86 architecture) have a less uniform, variable-length structure. 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.
Software instruction sets
Opcodes can 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.
See also
References
- Barron, David William (1978) . "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. (xii+100 pages)
- ^ Chiba, Shigeru (2007) . "Javassist, a Java-bytecode translator toolkit". Archived from the original on 2020-03-02. Retrieved 2016-05-27.
- "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.
- Jones, Douglas W. (June 1988). "A Minimal CISC". ACM SIGARCH Computer Architecture News. 16 (3). New York, USA: Association for Computing Machinery (ACM): 56–63. doi:10.1145/48675.48684. S2CID 17280173.
- Domagała, Łukasz (2012). "7.1.4. Benchmark suite". Application of CLP to instruction modulo scheduling for VLIW processors. Gliwice, Poland: Jacek Skalmierski Computer Studio. pp. 80–83 . ISBN 978-83-62652-42-6. Archived from the original on 2020-03-02. Retrieved 2016-05-28.
- Smotherman, Mark (2016) . "Multiple Instruction Issue". School of Computing, Clemson University. Archived from the original on 2016-05-28. Retrieved 2016-05-28.
- Jones, Douglas W. (2016) . "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.
- Schulman, Andrew (2005-07-01). "Finding Binary Clones with Opstrings & Function Digests". Dr. Dobb's Journal. Part I. Vol. 30, no. 7. CMP Media LLC. pp. 69–73. ISSN 1044-789X. #374. Archived from the original on 2020-03-02. Retrieved 2020-03-02; Schulman, Andrew (2005-08-01). "Finding Binary Clones with Opstrings & Function Digests". Dr. Dobb's Journal. Part II. Vol. 30, no. 8. CMP Media LLC. pp. 56–61. ISSN 1044-789X. #375. Archived from the original on 2020-03-02. Retrieved 2016-05-28; Schulman, Andrew (2005-09-01). "Finding Binary Clones with Opstrings & Function Digests". CMP Media LLC. Part III. Vol. 30, no. 9. United Business Media. pp. 64–70. ISSN 1044-789X. #376. Archived from the original on 2020-03-02. Retrieved 2016-05-28.
- ^ 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.
- Mansfield, Richard (1983). "Introduction: Why Machine Language?". Machine Language For Beginners. 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 from the original on 2008-02-13. Retrieved 2016-05-28.
- "bytecode Definition". PC Magazine. PC Magazine Encyclopedia. Archived from the original on 2012-10-06. Retrieved 2015-10-10.
x86 assembly topics | |
---|---|
Topics | |
Assemblers |
|
Programming issues |