In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) 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.
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. 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. 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. 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.
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).
Assembly language, or just assembly, is a low-level programming language, which uses mnemonic instructions and operands to represent machine code. This enhances the readability while still giving precise control over the machine instructions. Most programming is currently done using high-level programming languages, which are typically easier for humans to understand and write. These languages need to be compiled (translated into assembly language) by a system-specific compiler, or run through other compiled programs.
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.
- Gadget (machine instruction sequence)
- Illegal opcode
- Syllable (computing)
- ↑ 1.0 1.1 Floretin, J. John, ed (1978). "2.1. Symbolic instructions". written at University of Southampton, Southampton, UK. Assemblers and Loaders. Computer Monographs (3 ed.). New York, USA: Elsevier North-Holland Inc.. p. 7. ISBN 0-444-19462-2. (xii+100 pages)
- ↑ 2.0 2.1 "Javassist, a Java-bytecode translator toolkit". 2007. http://www.docjar.org/html/api/javassist/bytecode/InstructionPrinter.java.html.
- ↑ "Appendix B - Instruction Machine Codes". 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. http://bitsavers.trailing-edge.com/components/intel/MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf. Retrieved 2020-03-02.
- ↑ Raphael, Howard A., ed (November 1974). "The Functions Of A Computer: Instruction Register And Decoder". MCS-40 User's Manual For Logic Designers. Santa Clara, California, USA: Intel Corporation. p. viii. http://bitsavers.trailing-edge.com/components/intel/MCS40/MCS-40_Users_Manual_Nov74.pdf. Retrieved 2020-03-03. "[…] Each operation that the processor can perform is identified by a unique binary number known as an instruction code. […]"
- ↑ "A Minimal CISC". ACM SIGARCH Computer Architecture News (New York, USA: Association for Computing Machinery (ACM)) 16 (3): 56–63. June 1988. doi:10.1145/48675.48684.
- ↑ "7.1.4. Benchmark suite". Application of CLP to instruction modulo scheduling for VLIW processors. Gliwice, Poland: Jacek Skalmierski Computer Studio. 2012. pp. 80–83 . ISBN 978-83-62652-42-6. https://books.google.com/books?id=e6apNOED26kC. Retrieved 2016-05-28.
- ↑ "Multiple Instruction Issue". School of Computing, Clemson University. 2016. https://people.cs.clemson.edu/~mark/330/ilp.txt.
- ↑ "A Minimal CISC". Computer Architecture On-Line Collection. Iowa City, USA: The University of Iowa, Department of Computer Science. 2016. http://homepage.cs.uiowa.edu/~jones/arch/cisc/.
- ↑ "Finding Binary Clones with Opstrings & Function Digests". Dr. Dobb's Journal. Part I (CMP Media LLC) 30 (7): 69–73. 2005-07-01. #374. ISSN 1044-789X. http://www.drdobbs.com/finding-binary-clones-with-opstrings-fu/184406152. Retrieved 2020-03-02none ; "Finding Binary Clones with Opstrings & Function Digests". Dr. Dobb's Journal. Part II (CMP Media LLC) 30 (8): 56–61. 2005-08-01. #375. ISSN 1044-789X. http://www.drdobbs.com/finding-binary-clones-with-opstrings-fu/184406203. Retrieved 2016-05-28none ; "Finding Binary Clones with Opstrings & Function Digests". CMP Media LLC. Part III (United Business Media) 30 (9): 64–70. 2005-09-01. #376. ISSN 1044-789X. http://www.drdobbs.com/tools/finding-binary-clones-with-opstrings-fu/184406247. Retrieved 2016-05-28.
- ↑ 10.0 10.1 10.2 10.3 10.4 10.5 Computer architecture: A quantitative approach (6 ed.). Cambridge, Massachusetts, USA: Morgan Kaufmann Publishers. 2017-11-23. ISBN 978-0-12811905-1. OCLC 983459758.
- ↑ "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.. 1983. ISBN 0-942386-11-6. http://www.atariarchives.org/mlb/introduction.php. Retrieved 2016-05-28.
- ↑ "Programming Language Popularity". 2013-10-25. http://langpop.com/.
- ↑ "Introduction to Assembly Language". Swanson Technologies. 2001. http://www.swansontec.com/sprogram.htm.
- ↑ "bytecode Definition". PC Magazine. PC Magazine Encyclopedia. https://www.pcmag.com/encyclopedia_term/0,2542,t=bytecode&i=39108,00.asp. Retrieved 2015-10-10.
- Write Great Code: Thinking Low-level, Writing High-level. 1. San Francisco, California, USA: No Starch Press. 2004. p. passim. ISBN 1-59327003-8. https://books.google.com/books?isbn=1593270658. Retrieved 2015-10-10.
Original source: https://en.wikipedia.org/wiki/Opcode. Read more