Opcode: Difference between revisions

Content deleted Content added
CPUs: simplified and clarified
CPUs: simplified and clarified
Line 5:
 
==CPUs==
In CPUs, an opcode may be referred to as '''instruction machine code'''<ref name="Intel_1973_MCS-4"/>, '''instruction code'''<ref name="Intel_1974_MCS-40"/>, '''instruction syllable'''<ref name="Jones_1988_CISC"/><ref name="Domagała_2012"/><ref name="Smotherman_2013"/><ref name="Jones_2016_CISC"/>, '''instruction parcel''' or '''opstring'''<ref name="Schulman_2005"/><ref name="Chiba_2007"/>. Beside the opcode itself, most instructions also specify the data they will process, which are called [[operand]]s. Opcodes are usedfound in the [[instruction set architecture]]s (ISAs)instructions of CPUs, as well as in some [[virtual machine#Process virtual machines|abstract computing machines]].
 
SpecificationsFor andany format of the opcodes are laid out in the ISA of theparticular processor in question, (which may be a general CPU or a more specialized processing unit), the opcodes are defined by the processor's [[instruction set architecture]] (ISA).<ref name="Hennessy_2017"/> Opcodes for a givenparticular instruction setISA can be described through theby usemeans of an [[opcode table]] detailingwhich lists details of all possible opcodes. 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.<ref name="Hennessy_2017"/><ref name="Mansfield_1983"/> 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|date=February 2023}}
 
Apart from the opcode itself, an instruction normally also has one or more specifiers for operands on which the operation should act, although some operations may have ''implicit'' operands, or none at all.<ref name="Hennessy_2017"/> Depending on architecture, the operands may be [[processor register|register]] values, values in the [[call stack|stack]], other [[memory]] values, [[I/O]] ports (which may also be [[Memory-mapped I/O|memory mapped]]), etc., specified and accessed using more or less complex [[addressing mode]]s.{{citation needed|date=October 2015}} The types of operations include [[arithmetic]], data copying, [[logical operation]]s, and program control, as well as special instructions (such as [[CPUID]] and others).<ref name="Hennessy_2017"/>