This web page examines executable instructions in assembly language. Specific examples of instructions from various processors are used to illustrate the general nature of assembly language.
OSdata.com is used in more than 300 colleges and universities around the world
Find out how to get similar high web traffic and search engine placement.
Executable instructions can be divided into several broad categories of related operations.
data movement
Data movement instructions move data from one location to another. The source and destination locations are determined by the addressing modes, and can be registers or memory. Some processors have different instructions for loading registers and storing to memory, while other processors have a single instruction with flexible addressing modes. Data movement instructions generally have the greatest options for addressing modes. Data movement instructions typically come in a variety of sizes. Data movement instructions destroy the previous contents of the destination. Data movement instructions typically set and clear processor flags. When the destination is a register and the data is smaller than the full register size, the data might be placed only in the low order bits (leaving high order bits unchanged), or might be zero- or sign-extended to fill the entire register (some processors only use one choice, others permit the programmer to choose how this is handled). Register to register operations can usually have the same source and destination register.
Earlier processors had different instructions and different names for different kinds of data movement, while most modern processors group data movement into a single symbolic name, with different kinds of data movement being indicated by address mode and size designation. A load instruction loads a register from memory. A store instruction stores the contents of a register into memory. A transfer instruction loads a register from another register. In processors that have separate names for different kinds of data moves, a memory to memory data move might be specially designated as a move instruction.
An exchange instruction exchanges the contents of two registers, two memory locations, or a register and a memory location (although some processors only have register-register exchanges or other limitations).
Some processors include versions of data movement instructions that can perform simple operations during the data move (such as compliment, negate, or absolute value).
Some processors include instructions that can save (to memory) or restore (from memory) a block of registers at one time (useful for implementing subroutines).
Some processors include instructions that can move a block of memory from one location to another at one time. If a processor includes string instructions, then there will usually be a string instruction that moves a string from one location in memory to another.
MOVE Move Data; Motorola 680x0, Motorola 68300; move a byte (MOVE.B 8 bits), word (MOVE.W 16 bits), or longword (MOVE.L 32 bits) of data; memory to memory, memory to register, register to memory, or register to register; moves of byte and word data to registers leaves high order bits unchanged; sets or clears flags
MOV Move Data; Intel 80x86; move a byte (8 bits), word (16 bits), or doubleword (32 bits) of data; memory to register, register to memory, or register to register (cannot move data from memory to memory or from segment register to segment register); does not affect flags
MOV Move Data; DEC VAX; move a byte (MOVB 8 bits), word (MOVW 16 bits), longword (MOVL 32 bits), quadword (MOVQ 64 bits), octaword (MOVQ 128 bits), single precision floating (MOVF 32 bits), double precision floating (MOVD 64 bits), G floating (MOVG 64 bits), or H floating (MOVH 128 bits) of data; memory to memory, memory to register, register to memory, or register to register; moves of byte and word data to registers leaves high order bits unchanged; quadword, D float, and G float moves to or from registers are consecutive register pairs, octaword, and H float moves to or from registers are four consecutive registers; and sets or clears flags
PUSH Push; Intel 80x86; decrement stack pointer and move a word (16 bits) or doubleword (32 bits) of data from memory or register (or byte of immediate data) onto stack; does not affect flags
PUSHL Push Long; DEC VAX; decrement stack pointer (R14) and move a longword (32 bits) of data from memory or register onto stack; equivalent to MOVL src, -(SP), but shorter and executes faster; sets or clears flags
POP Pop; Intel 80x86; move a word (16 bits) or doubleword (32 bits) of data from top of stack to register or memory and increment stack pointer; does not affect flags
LR Load from Register; IBM 360/370; RR format; move a full word (32 bits) of data; register to register only; does not affect condition code
L Load (from main storage); IBM 360/370; RX format; move a full word (32 bits) of data; main storage to register only; does not affect condition code
LH Load Half-word; IBM 360/370; RX format; move a half-word (16 bits) of data; main storage to register only; does not affect condition code
LDA Load A-register; MIX; move word or partial word field of data; main storage to accumulator only
LDX Load X-register; MIX; move word or partial word field of data; main storage to extension register only
LDi Load index-register; MIX; move word or partial word field of data; main storage to one of five index registers only
ST Store (into main storage); IBM 360/370; RX format; move a full word (32 bits) of data; register to main storage only; does not affect condition code
STH Store Half-word; IBM 360/370; RX format; move a half-word (16 bits) of data; register to main storage only; does not affect condition code
STA Store A-register; MIX; move word or partial word field of data; accumulator to main storage only
STX Store X-register; MIX; move word or partial word field of data; extension register to main storage only
STi Store index-register; MIX; move word or partial word field of data; one of five index registers to main storage only
MVI MoVe Immediate; IBM 360/370; SI format; move a character (8 bits) of data; immediate data to register only; does not affect condition code
MOVEQ Move Quick; Motorola 680x0, Motorola 68300; moves byte (8 bits) of sign-extended data (32 bits) to a data register; sets or clears flags
CLR Clear; Motorola 680x0, Motorola 68300; clears a register or contents of a memory location (.B 8, .W 16, or .L 32 bits) to zero; clears flags for memory and data registers, does not modify flags for address register
CLR Clear; DEC VAX; clears a scalar quantity in register or memory to zero (CLRB 8 bits, CLRW 16 bits, CLRL 32 bits, CLRQ 64 bits, CLRO 128 bits, CLRF 32 bit float, or CLRD 64 bit float), an integer CLR will clear the same size floating point quantity because VAX floating point zero is represented as all zero bits; quadword and D float clears of registers are consecutive register pairs, octaword clears to registers are four consecutive registers; equivalent to MOVx #0, dst, but shorter and executes faster; sets or clears flags
STZ Store Zero; MIX; move word or partial word field of data, store zero into designated word or field of word of memory
EXG Exchange; Motorola 680x0, Motorola 68300; exchanges the data (32 bits) in two data registers; does not affect flags
XCHG Exchange; Intel 80x86; exchanges the data (16 bits or 32 bits) in a register with the AX or EAX register or exchanges the data (8 bits, 16 bits, or 32 bits) in a register with the contents of an effective address (register or memory); LOCK prefix and LOCK# signal asserted in XCGHs involving memory; does not affect flags
MOVSX Move with Sign Extension; Intel 80x86; moves data from a register or memory to a register, with a sign extension (conversion to larger binary integer: byte to word, byte to doubleword, or word to doubleword); does not affect flags
MOVZX Move with Zero Extension; Intel 80x86; moves data from a register or memory to a register, with a zero extension (conversion to larger binary integer: byte to word, byte to doubleword, or word to doubleword); does not affect flags
MOVZ Move Zero Extended; DEC VAX; moves an unsigned integer to a larger unsigned integer with zero extend, source and destination in register or memory (MOVZBW Byte to Word, MOVZBL Byte to Long, MOVZWL Word to Long); sets or clears flags
MCOM Move Complemented; DEC VAX; moves the logical complement (ones complement) of an integer to register or memory (MCOMB 8 bits, MCOMW 16 bits, or MCOML 32 bits); sets or clears flags
LCR Load Complement from Register; IBM 360/370; RR format; fetches a full word (32 bits) of data from one of 16 general purpose registers, complements the data, and stores a full word (32 bits) of data in one of 16 general purpose registers; register to register only; sets or clears flags
LPR Load Positive from Register (absolute value); IBM 360/370; RR format; fetches a full word (32 bits) of data from one of 16 general purpose registers, creates the absolute value (positive) the data, and stores a full word (32 bits) of data in one of 16 general purpose registers; register to register only; sets or clears flags
MNEG Move Negated; DEC VAX; moves the arithmetic negative of a scalar quantity to register or memory (MNEGB 8 bits, MNEGW 16 bits, MNEGL 32 bits, MNEGQ 64 bits, MNEGF 32 bit float, or MNEGD 64 bit float); if source is positive zero, result is also positive zero; sets or clears flags
LNR Load Negative from Register (negative of absolute value); IBM 360/370; RR format; fetches a full word (32 bits) of data from one of 16 general purpose registers, creates the absolute value the data, complements (negative) the absolute value of the data, and stores a full word (32 bits) of data in one of 16 general purpose registers; register to register only; sets or clears flags
LDAN Load A-register Negative; MIX; move word or partial word field of data, load sign field with opposite sign; main storage to accumulator only
LDXN Load X-register Negative; MIX; move word or partial word field of data, load sign field with opposite sign; main storage to extension register only
LDiN Load index-register Negative; MIX; move word or partial word field of data, load sign field with opposite sign; main storage to one of five index registers only
STZ Store Zero; MIX; move word or partial word field of data, store zero into designated word or field of word of memory
MVC MoVe Character; IBM 360/370; SS format; moves one to 256 characters (8 bits each) of data; main storage to main storage only; does not affect condition code
MOVE Move (block); MIX; move the number of words specified by the F field from location M to the location specified by the contents of index register 1, incrementing the index register on each word moved
MOVEM Move Multiple; Motorola 680x0, Motorola 68300; move contents of a list of registers to memory or restore from memory to a list of registers; does not affect condition code
LM Load Multiple; IBM 360/370; RS format; moves a series of full words (32 bits) of data from memory to a series of general purpose registers; main storage to register only; does not affect condition code
STM STore Multiple; IBM 360/370; RS format; moves contents of a series of general purpose registers to a series of full words (32 bits) in memory; register to main storage only; does not affect condition code
PUSHA Push All Registers; Intel 80x86; move contents all 16-bit general purpose registers to memory pointed to by stack pointer (in the order AX, CX, DX, BX, original SP, BP, SI, and DI ); does not affect flags
PUSHAD Push All Registers; Intel 80386; move contents all 32-bit general purpose registers to memory pointed to by stack pointer (in the order EAX, ECX, EDX, EBX, original ESP, EBP, ESI, and EDI ); does not affect flags
POPA Pop All Registers; Intel 80x86; move memory pointed to by stack pointer to all 16-bit general purpose registers (except for SP); does not affect flags
POPAD Pop All Registers; Intel 80386; move memory pointed to by stack pointer to all 32-bit general purpose registers (except for ESP); does not affect flags
STJ Store jump-register; MIX; move word or partial word field of data; jump register to main storage only
MOVEP Move Peripheral Data; Motorola 680x0, Motorola 68300; moves data (16 bits or 32 bits) from a data register to memory mapped peripherals or moves data from memory mapped peripherals to a data register, skipping every other byte
address movement
Address movement instructions move addresses from one location to another. The source and destination locations are determined by the addressing modes, and can be registers or memory. Address movement instructions can come in a variety of sizes. Address movement instructions destroy the previous contents of the destination. Address movement instructions typically do not modify processor flags. When the destination is a register and the address is smaller than the full register size, the data might be placed only in the low order bits (leaving high order bits unchanged), or might be zero- or sign-extended to fill the entire register (some processors only use one choice, others permit the programmer to choose how this is handled).
MOVEA.W Move Address (Word); Motorola 680x0, Motorola 68300; move an address word (16 bits) as sign-extended data (32 bits); memory to address register or register to address register; does not modify flags
MOVEA.L Move Address (Longword); Motorola 680x0, Motorola 68300; move an address longword (32 bits); memory to address register or register to address register; does not modify flags
LEA Load Effective Address; Motorola 680x0, Motorola 68300; computes an effective address and loads the result into an address register
LA Load Address; RX format; IBM 360/370; computes an effective address and loads the 24-bit result (zero extended to 32-bits) into a general purpose register; does not affect condition code
ENTA Enter A-register; MIX; move word or partial word field contents of index register to A-register (accumulator)
ENTX Enter X-register; MIX; move word or partial word field contents of index register to X-register (extension)
ENTi Enter I-register; MIX; move word or partial word field contents of index register to designated index register
ENNA Enter Negative A-register; MIX; move word or partial word field contents of index register to A-register (accumulator), opposite sign loaded
ENNX Enter Negative X-register; MIX; move word or partial word field contents of index register to X-register (extension), opposite sign loaded
ENNi Enter Negative I-register; MIX; move word or partial word field contents of index register to designated index register, opposite sign loaded
INCA Increase A-register; MIX; add word or partial word field contents of memory to A-register (accumulator), overflow toggle possibly set
INCX Increase X-register; MIX; add word or partial word field contents of memory to X-register (extension), overflow toggle possibly set
INCi Increase I-register; MIX; add word or partial word field contents of memory to designated index register, overflow toggle possibly set
DECA Decrease A-register; MIX; subtract word or partial word field contents of memory from A-register (accumulator), overflow toggle possibly set
DECX Decrease X-register; MIX; subtract word or partial word field contents of memory from X-register (extension), overflow toggle possibly set
DECi Decrease I-register; MIX; subtract word or partial word field contents of memory from designated index register, overflow toggle possibly set
PEA Push Effective Address; Motorola 680x0, Motorola 68300; computes an effective address and pushes the result onto a stack (predecrementing an address register acting as a stack pointer)
LINK Link Stack; Motorola 680x0, Motorola 68300
UNLK Unlink Stack; Motorola 680x0, Motorola 68300
integer arithmetic
For most processors, integer arithmetic is faster than floating point arithmetic. This can be reversed in special cases such digital signal processors.
The basic four integer arithmetic operations are addition, subtraction, multiplication, and division. Arithmetic operations can be signed or unsigned (unsigned is useful for effective address computations). Some older processors dont include hardware multiplication and division. Some processors dont include actual multiplication or division hardware, instead looking up the answer in a massive table of results embedded in the processor.
A specialized, but common, form of addition is an increment instruction, which adds one to the contents of a register or memory location. For address computations, increment may mean the addition of a constant other than one. Some processors have short or quick addition instructions that extend increment to include a small range of positive values.
A specialized, but common, form of subtraction is an decrement instruction, which subtracts one from the contents of a register or memory location. For address computations, decrement may mean the subtraction of a constant other than one. Some processors have short or quick subtraction instructions that extend decrement to include a small range of values.
Compare instructions are used to examine one or more integers non-destructively. These are usually implemented by performing a subtraction in some shadow register or accumulator and then setting flags accordingly. Compare instructions can compare two integers, or can compare a single integer to zero. Triadic compare instructions compare a test value to an upper and lower limit, which can be useful for bounds and range checking.
Some processors have specific hardware support for large multi-byte integer arithmetic. Even if there is no specific support, generally carry and borrow flags can be used to implement software multi-byte arithmetic routines.
Some processors have other special integer arithmetic operations. A clear instruction sets a register or memory location to zero. Some processors have special instructions for setting a register to a special value (such as pi) with additional guard bits also being set appropriately. A sign extend operation takes a small value and sign extends it to a larger storage format (such as byte to word). An arithmetic complement gives the arithmetic complement of a number (ones complement). An arithmetic negate gives the arithmetic inverse of a number (subtract from zero; twos complement).
ADD Arithmetic Addition; DEC VAX; signed addition of scalar quantities (8, 16, or 32 bit integer or 32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand added to second operand with result replacing second operand) and three operand (first operand added to second operand with result placed in third operand) (ADDB2 add byte 2 operand, ADDB3 add byte 3 operand, ADDW2 add word 2 operand, ADDW3 add word 3 operand, ADDL2 add long 2 operand, ADDL3 add long 3 operand, ADDF2 add float 2 operand, ADDF3 add float 3 operand, ADDD2 add double float 2 operand, ADDD3 add double float 3 operand, ADDG2 add G float 2 operand, ADDG3 add G float 3 operand, ADDH2 add H float 2 operand, ADDH3 add H float 3 operand); clears or sets flags
ADD Add Integers; Intel 80x86; integer add of the contents of a register or memory (8, 16, or 32 bits) to a memory location or a register; sets or clear flags
ADD Add; Motorola 680x0, Motorola 68300; signed add of the contents of a data register (8, 16, or 32 bits) to a memory location or adds the contents of a memory location (8, 16, or 32 bits) to a data register; sets or clear flags
ADD Add; MIX; add word or partial word field contents of memory to A-register (accumulator), overflow toggle set if result is too large for A-register
AR Add Register; IBM 360/370; RR format; signed add of the contents of a general purpose register (32 bits) to a general purpose register (32 bits); register to register only; sets or clears flags
A Add; IBM 360/370; RX format; signed add of the contents of a memory location (32 bits) to a general purpose register (32 bits); main memory to register only; sets or clears flags
AH Add Half-word; IBM 360/370; RX format; signed add of the contents of a memory location (16 bits) to a general purpose register (low order 16 bits); main memory to register only; sets or clears flags
ADDA Add Address; Motorola 680x0, Motorola 68300; unsigned add of the contents of a memory location or register (16 or 32 bits) to an address register; does not modify flags
ADDI Add Immediate; Motorola 680x0, Motorola 68300; signed add of immediate data (8, 16, or 32 bits) to a register or memory location; sets or clears flags
ADDQ Add Quick; Motorola 680x0, Motorola 68300; signed add of an immediate value of 1 to 8 inclusive to a register or memory lcoation; sets or clears flags for data registers and memory locations, does not modify flags for an address register
INC Increment; DEC VAX; increments the integer contents of a general purpose register or contents of memory (INCB byte, INCW word, INCL longword); equivalent to ADDx2 #1, sum, but shorter and executes faster; clears or sets flags
INC Increment by 1; Intel 80x86; increments the contents of a register or memory (8, 16, or 32 bits); sets or clear flags (does not modify carry flag)
ADWC Add With Carry; DEC VAX; integer addition (32 bit) in general purpose registers or memory, first operand added to second operand and the C (carry) flag with result replacing second operand; used for multiprecision arithmetic; clears or sets flags
ADC Add Integers with Carry; Intel 80x86; integer add of the contents of a register or memory (8, 16, or 32 bits) and the carry flag to a memory location or a register, used to implement multi-precision integer arithmetic; sets or clear flags
ADDX Add Extended; Motorola 680x0, Motorola 68300; (signed add of a data register [8, 16, or 32 bits] and the extend bit to a data register) or (signed add of the contents of memory location [8, 16, or 32 bits] and the extend bit to the contents of another memory location while predecrementing both the source and destination address pointer registers), used to implement multi-precision integer arithmetic; sets or clears flags
SUB Subtract; DEC VAX; signed subtraction of scalar quantities (8, 16, or 32 bit integer) in general purpose registers or memory, available in two operand (first operand subtracted from second operand with result replacing second operand) and three operand (first operand subtracted from second operand with result placed in third operand) (SUBB2 subtract byte 2 operand, SUBB3 subtract byte 3 operand, SUBW2 subtract word 2 operand, SUBW3 subtract word 3 operand, SUBL2 subtract long 2 operand, SUBL3 subtract long 3 operand); clears or sets flags
SUB Subtract Integers; Intel 80x86; integer subtraction of the contents of a register or memory (8, 16, or 32 bits) from a memory location or a register; sets or clear flags
SUB Subtract; Motorola 680x0, Motorola 68300; signed subtract of the contents of a data register (8, 16, or 32 bits) from a memory location or subtracts the contents of a memory location (8, 16, or 32 bits) from a data register; sets or clear flags
SUB Subtract; MIX; subtract word or partial word field contents of memory from A-register (accumulator), overflow toggle possibly set
SR Subtract Register; IBM 360/370; RR format; signed subtract of the contents of a general purpose register (32 bits) from a general purpose register (32 bits); register to register only; sets or clears flags
S Subtract; IBM 360/370; RX format; signed subtract of the contents of a memory location (32 bits) from a general purpose register (32 bits); main memory to register only; sets or clears flags
SH Subtract Half-word; IBM 360/370; RX format; signed subtract of the contents of a memory location (16 bits) from a general purpose register (low order 16 bits); main memory to register only; sets or clears flags
SUBA Subtract Address; Motorola 680x0, Motorola 68300; unsigned subtract of the contents of a memory location or register (16 or 32 bits) from an address register; does not modify flags
SUBI Subtract Immediate; Motorola 680x0, Motorola 68300; signed subtract of immediate data (8, 16, or 32 bits) from a register or memory location; sets or clears flags
SUBQ Subtract Quick; Motorola 680x0, Motorola 68300; signed subtract of an immediate value of 1 to 8 inclusive from a register or memory lcoation; sets or clears flags for data registers and memory locations, does not modify flags for an address register
DEC Decrement; DEC VAX; decrements the integer contents of a general purpose register or contents of memory (DECB byte, DECW word, DECL longword); equivalent to SUBx2 #1, sum, but shorter and executes faster; clears or sets flags
DEC Decrement by 1; Intel 80x86; decrements the contents of a register or memory (8, 16, or 32 bits); sets or clear flags (does not modify carry flag)
SBWC Subtract With Carry; DEC VAX; integer subtraction (32 bit) in general purpose registers or memory, first operand and the C (carry) flag subtracted from second operand with result replacing second operand; used for extended precision subtraction; clears or sets flags
SBB Subtract Integers with Borrow; Intel 80x86; integer subtraction of the contents of a register or memory (8, 16, or 32 bits) and carry flag from a memory location or a register; sets or clear flags
SUBX Subtract Extended; Motorola 680x0, Motorola 68300; (signed subtract of a data register [8, 16, or 32 bits] and the extend bit from a data register) or (signed subtract of the contents of memory location [8, 16, or 32 bits] and the extend bit from the contents of another memory location while predecrementing both the source and destination address pointer registers), used to implement multi-precision integer arithmetic; sets or clears flags
MUL Multiply; DEC VAX; signed multiplication of scalar quantities (8, 16, or 32 bit integer) in general purpose registers or memory, available in two operand (first operand multiplied by second operand with result replacing second operand) and three operand (first operand multiplied by second operand with result placed in third operand) (MULB2 multiply byte 2 operand, MULB3 multiply byte 3 operand, MULW2 multiply word 2 operand, MULW3 multiply word 3 operand, MULL2 multiply long 2 operand, MULL3 multiply long 3 operand); clears or sets flags
MULS.W Signed Multiply; Motorola 680x0, Motorola 68300; signed multiplication of a word (16 bits) from memory or a register by a word (16 bits) in a data register with a longword (32 bit) result stored in the entire data register; sets or clears flags
MULS.L Signed Multiply; Motorola 680x0, Motorola 68300; signed multiplication of a longword (32 bits) from memory or a register by a longword (32 bits) in a data register with a longword (32 bit) result stored in the data register (high order 32 bits of product are discarded); sets or clears flags
MULS.L <ea>,Dh:Dl Signed Multiply; Motorola 680x0, Motorola 68300; signed multiplication of a longword (32 bits) from a data register by a longword (32 bits) in a data register with a quadword (64 bit) result stored in the data registers (high order 32 bits of product in first register, low order 32 bits of product in second data register); sets or clears flags
MULU.W Unsigned Multiply; Motorola 680x0, Motorola 68300; unsigned multiplication of a word (16 bits) from memory or a register by a word (16 bits) in a data register with a longword (32 bit) result stored in the entire data register; sets or clears flags
MULU.L Unsigned Multiply; Motorola 680x0, Motorola 68300; unsigned multiplication of a longword (32 bits) from memory or a register by a longword (32 bits) in a data register with a longword (32 bit) result stored in the data register (high order 32 bits of product are discarded); sets or clears flags
MULU.L <ea>,Dh:Dl Unsigned Multiply; Motorola 680x0, Motorola 68300; unsigned multiplication of a longword (32 bits) from a data register by a longword (32 bits) in a data register with a quadword (64 bit) result stored in the data registers (high order 32 bits of product in first register, low order 32 bits of product in second data register); sets or clears flags
MUL Unsigned Multiplication of AL or AX; Intel 80x86; unsigned multiplication of a byte (8 bits) from register or memory by the contents of the AL register with a word (16-bit) result in AX register, or unsigned multiplication of a word (16 bits) from register or memory by the contents of the AX register with a doubleword (32-bit) result in DX:AX register pair, or unsigned multiplication of a doubleword (32 bits) from register or memory by the contents of the EAX register with a quadword (64-bit) result in EDX:EAX register pair; uses an early out algorithm to speed up computations when possible; sets or clears flags
IMUL Signed Integer Multiply; Intel 80x86; signed multiplication of a byte (8 bits), word (16 bits), or doubleword (32 bits) from register or memory by the contents of the EAX and EDX registers with result stored in the EAX and EDX registers, signed multiplication of a byte (8 bits), word (16 bits), or doubleword (32 bits) from register or memory by the contents of a register with truncated results (to size as operands) stored in the register, or signed multiplication of a byte (8 bits), word (16 bits), or doubleword (32 bits) from register or memory by the contents of an immediate value with truncated results (to size as operands) stored in any general register; uses an early out algorithm to speed up computations when possible; sets or clears flags
MUL Multiply; MIX; multiply word or partial word field contents of memory to A-register (accumulator) with results stored in X-register and A-register pair, overflow toggle possibly set
MR Multiply Register; IBM 360/370; RR format; signed multiply of the contents of an even numbered general purpose register (32 bits) by the contents of the immediately following odd numbered general purpose register (32 bits) with a 64-bit product in the register pair; register to register only; does not affect condition code
M Multiply; IBM 360/370; RX format; signed multiply of the contents of a memory location (32 bits) by the contents of an odd numbered general purpose register (32 bits) with a 64-bit product in the register pair; main storage to register only; does not affect condition code
MH Multiply Half-word; IBM 360/370; RX format; signed multiply of the contents of a memory location (16 bits) by the contents of a general purpose register (32 bits) with a 32-bit product (the high 8 bits of the true 48-bit product are discarded) in the register; main storage to register only; does not affect condition code
EMUL Extended Multiply; DEC VAX; extended precision multiplication on operands in registers or memory, the first (longword) operand (multiplicand) is multiplied by the second (longword) operand (multiplier) giving a (doubleword) intermediary result which is stored in the fourth (doubleword) operand (product); clears or sets flags
EMOD Extended Multiply and Integerize; DEC VAX; performs accurate range reduction of math function arguments, the floating point multiplier extension operand (second operand) is concatenated with the floating point multiplier (first operand) to gain eight additional low order fraction bits, the multiplicand operand (third operand) is multiplied by the extended multiplier operand, after multiplication the integer portion (fourth operand) is extracted and a 32 bit (EMODF) or 64 bit (EMODD) floating point number is formed from the fractional part of the product by truncating extra bits, the multiplication is such that the result is equivalent to the exact product truncated (before normalization) to a fraction field of 32 bits in floating or 64 bits in double (fifth operand); clears or sets flags
DIVS.W Signed Divide; Motorola 680x0, Motorola 68300; signed division of a longword (32 bits) in memory or a register by a word (16 bits) in a data register with a result of the quotient (16 bits) in the lower word and the remainder (16 bits) in the upper word of the data register; clears or sets flags
DIVS.L <ea>,Dq Signed Divide; Motorola 680x0, Motorola 68300; signed division of a longword (32 bits) in memory or a register by a longword (32 bits) in a data register with a result of a longword (32 bit) quotient in the data register and the remainder being discarded; clears or sets flags
DIVS.L <ea>,Dr:Dq Signed Divide; Motorola 680x0, Motorola 68300; signed division of a quadword (64 bits) in any two data registers by a longword (32 bits) in a data register with a result of the quotient (32 bits) in the second data register and the remainder (32 bits) in the third data register; clears or sets flags
DIVSL.L <ea>,Dr:Dq Signed Divide; Motorola 680x0, Motorola 68300; signed division of a longword (32 bits) in a data register by a longword (32 bits) in a second data register with a result of the quotient (32 bits) in the first data register and the remainder (32 bits) in the second data register; clears or sets flags
DIVU.W Unsigned Divide; Motorola 680x0, Motorola 68300; unsigned division of a longword (32 bits) in memory or a register by a word (16 bits) in a data register with a result of the quotient (16 bits) in the lower word and the remainder (16 bits) in the upper word of the data register; clears or sets flags
DIVU.L <ea>,Dq Unsigned Divide; Motorola 680x0, Motorola 68300; unsigned division of a longword (32 bits) in memory or a register by a longword (32 bits) in a data register with a result of a longword (32 bit) quotient in the data register and the remainder being discarded; clears or sets flags
DIVU.L <ea>,Dr:Dq Unsigned Divide; Motorola 680x0, Motorola 68300; unsigned division of a quadword (64 bits) in any two data registers by a longword (32 bits) in a data register with a result of the quotient (32 bits) in the second data register and the remainder (32 bits) in the third data register; clears or sets flags
DIVUL.L <ea>,Dr:Dq Unsigned Divide; Motorola 680x0, Motorola 68300; unsigned division of a longword (32 bits) in a data register by a longword (32 bits) in a second data register with a result of the quotient (32 bits) in the first data register and the remainder (32 bits) in the second data register; clears or sets flags
DR Divide Register; IBM 360/370; RR format; signed divide of the contents of a general purpose register pair (64 bits) by the contents of a general purpose register (32 bits) with a 32-bit quotient in the odd numbered register and a 32-bit remainder in the even numbered register of the register pair; register to register only; does not affect condition code
D Divide; IBM 360/370; RX format; signed divide of the contents of a general purpose register pair (64 bits) by the contents of a memory location (32 bits) with a 32-bit quotient in the odd numbered register and a 32-bit remainder in the even numbered register of the register pair; main storage to register only; does not affect condition code
DIV Divide; DEC VAX; arithmetic division of scalar quantities (8, 16, or 32 bit integer or 32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand [divisor] divided from second operand [dividend] with result [quotient] replacing second operand) and three operand (first operand [divisor] divided from second operand [dividend] with result placed in third operand [quotient]) (DIVB2 divide byte 2 operand, DIVB3 divide byte 3 operand, DIVW2 divide word 2 operand, DIVW3 divide word 3 operand, DIVL2 divide long 2 operand, DIVL3 divide long 3 operand, DIVF2 divide float 2 operand, DIVF3 divide float 3 operand, DIVD2 divide double float 2 operand, DIVD3 divide double float 3 operand, DIVG2 divide G float 2 operand, DIVG3 divide G float 3 operand, DIVH2 divide H float 2 operand, DIVH3 divide H float 3 operand); clears or sets flags
EDIV Extended Divide; DEC VAX; extended precision multiplication on operands in registers or memory, the second (longword) operand (dividend) is divided from the first (longword) operand (divisor) giving the third (longword) operand (quotient) and the the fourth (longword) operand (remainder); clears or sets flags
DIV Unsigned Divide; Intel 80x86; unsigned division of the accumulator by a byte (8 bits), word (16 bits), or doubleword (32 bits) divisor of half the size of the dividend in the accumulator, with the results stored in the accumulator (byte divisor: dividend is in the AX register, quotient in the AL register, and remainder in the AH register; word divisor: dividend is in the DX:AX register pair, quotient in the AX register, and remainder in the DX register; doubleword divisor: dividend is in the EDX:AEX register pair, quotient in the EAX register, and remainder in the EDX register); non-integral quotients are truncated to integers toward 0; sets or clears flags
IDIV Signed Integer Division; Intel 80x86; Intel 80x86; signed division of the accumulator by a byte (8 bits), word (16 bits), or doubleword (32 bits) divisor of half the size of the dividend in the accumulator, with the results stored in the accumulator (byte divisor: dividend is in the AX register, quotient in the AL register, and remainder in the AH register; word divisor: dividend is in the DX:AX register pair, quotient in the AX register, and remainder in the DX register; doubleword divisor: dividend is in the EDX:AEX register pair, quotient in the EAX register, and remainder in the EDX register); non-integral quotients are truncated to integers toward 0; sets or clears flags
DIV Divide; MIX; divide word or partial word field contents of memory from A-register (accumulator) and X-register (extension) pair with quotient stored in A-register and remainder stored in X-register, overflow toggle possibly set
CMP Compare; DEC VAX; arithmetic comparison between two scalar quantities (8, 16, or 32 bit integer or 32 or 64 bit floating point) in general purpose registers or memory (CMPB Byte, CMPW Word, CMPL Longword, CMPF Floating, CMPD Double Float); clears or sets flags
TST Test; DEC VAX; arithmetic comparison of a scalar quantities (8, 16, or 32 bit integer or 32 or 64 bit floating point) in general purpose registers or memory (TSTB Byte, TSTW Word, TSTL Longword, TSTF Floating, TSTD Double Float) to zero; equivalent to CMPs src, #0, but shorter and executes faster; clears or sets flags
CMP Compare; Motorola 680x0, Motorola 68300; compares a register or contents of a memory location (8, 16, or 32 bits) to contents of a data register (data register minus effective address contents); clears or sets flags
CMP Compare Two Operands; Intel 80x86; compares a register or contents of a memory location (8, 16, or 32 bits) to contents of a register or memory location (subtract of second operand from first operand with no storage of results, but setting or clearing of flags); clears or sets flags
CMPA Compare A-register; MIX; compare word or partial word field contents of memory with same word or partial field of A-register (accumulator), set comparison indicator
CMPX Compare X-register; MIX; compare word or partial word field contents of memory with same word or partial field of X-register (extension), set comparison indicator
CMPi Compare I-register; MIX; compare word or partial word field contents of memory with same word or partial field of designated index register, set comparison indicator
CMPA Compare Address; Motorola 680x0, Motorola 68300; compares a register or contents of a memory location (16 or 32 bits) to contents of an address register (adress register minus effective address contents); clears or sets flags
CMPI Compare Immediate; Motorola 680x0, Motorola 68300; compares immediate data (8, 16, or 32 bits) to contents of a register or memory (effective address contents minus immediate data); clears or sets flags
CMPM Compare Memory; Motorola 680x0, Motorola 68300; compares the contents of two memory locations (8, 16, or 32 bits) with a post increment of both address pointer registers (second location minus first location); clears of sets flags
CMP2 Compare Register Against Bounds; Motorola 680x0, Motorola 68300; compares the contents of register (8, 16, or 32 bits) to a bounds pair (lower bound followed by upper bound), if both bounds are equal then this operation tests for a specific value; sets or clears flags
CLR Clear; Motorola 680x0, Motorola 68300; clears a register or contents of a memory location (.B 8, .W 16, or .L 32 bits) to zero; clears flags for memory and data registers, does not modify flags for address register
CLR Clear; DEC VAX; clears a scalar quantity in register or memory to zero (CLRB 8 bits, CLRW 16 bits, CLRL 32 bits, CLRQ 64 bits, CLRO 128 bits, CLRF 32 bit float, or CLRD 64 bit float), an integer CLR will clear the same size floating point quantity because VAX floating point zero is represented as all zero bits; quadword and D float clears of registers are consecutive register pairs, octaword clears to registers are four consecutive registers; equivalent to MOVx #0, dst, but shorter and executes faster; sets or clears flags
STZ Store Zero; MIX; move word or partial word field of data, store zero into designated word or field of word of memory
EXT Sign Extend; Motorola 680x0, Motorola 68300; sign extends a byte (8 bits) in a data register to a word (16 bits) or sign extends a word (16 bits) in a data register to a longword (32 bits); sets or clears flags
EXTB Sign Extend Byte; Motorola 680x0, Motorola 68300; sign extends a byte (8 bits) in a data register to a longword (32 bits); sets or clears flags
NEG Twos Complement Negation; Intel 80x86; subtracts the contents of a register or memory (8, 16, or 32 bits) from zero and store the results in the original register or memory location (arithmetic negation or arithmetic inverse); sets or clears flags
NEG Negate; Motorola 680x0, Motorola 68300; subtracts the contents of a register or memory (8, 16, or 32 bits) from zero and store the results in the original register or memory location (arithmetic negation or arithmetic inverse); sets or clears flags
NEGX Negate with Extend; Motorola 680x0, Motorola 68300; subtracts the contents of a register or memory location (8, 16, or 32 bits) and the extend bit from zero and stores the results in the original register or memory location (multi-precision negation); sets or clears flags
floating point arithmetic
On many processors, floating point arithmetic is in an optional unit or optional coprocessor rather than being included on the main processor. This allows the manufacturer to charge less for the business machines that dont need floating point arithmetic.
The basic four floating point arithmetic operations are addition, subtraction, multiplication, and division. Some processors dont include actual multiplication or division hardware, instead looking up the answer in a massive table of results embedded in the processor.
Compare instructions are used to examine one or more floating point numbers non-destructively. These are usually implemented by performing a subtraction in some shadow register or accumulator and then setting flags accordingly. Compare instructions can compare two floating point numbers, or can compare a single floating point number to zero.
ADD Arithmetic Addition; DEC VAX; signed addition of scalar quantities (8, 16, or 32 bit integer or 32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand added to second operand with result replacing second operand) and three operand (first operand added to second operand with result placed in third operand) (ADDF2 add float 2 operand, ADDF3 add float 3 operand, ADDD2 add double float 2 operand, ADDD3 add double float 3 operand, ADDG2 add G float 2 operand, ADDG3 add G float 3 operand, ADDH2 add H float 2 operand, ADDH3 add H float 3 operand); clears or sets flags
SUB Subtract; DEC VAX; signed subtraction of scalar quantities (32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand subtracted from second operand with result replacing second operand) and three operand (first operand subtracted from second operand with result placed in third operand) (SUBF2 subtract float 2 operand, SUBF3 subtract float 3 operand, SUBD2 subtract double float 2 operand, SUBD3 subtract double float 3 operand, SUBG2 subtract G float 2 operand, SUBG3 subtract G float 3 operand, SUBH2 subtract H float 2 operand, SUBH3 subtract H float 3 operand); clears or sets flags
MUL Multiply; DEC VAX; signed multiplication of scalar quantities (32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand multiplied by second operand with result replacing second operand) and three operand (first operand multiplied by second operand with result placed in third operand) (MULF2 multiply float 2 operand, MULF3 multiply float 3 operand, MULD2 multiply double float 2 operand, MULD3 multiply double float 3 operand, MULG2 multiply G float 2 operand, MULG3 multiply G float 3 operand, MULH2 multiply H float 2 operand, MULH3 multiply H float 3 operand); clears or sets flags
EMOD Extended Multiply and Integerize; DEC VAX; performs accurate range reduction of math function arguments, the floating point multiplier extension operand (second operand) is concatenated with the floating point multiplier (first operand) to gain eight additional low order fraction bits, the multiplicand operand (third operand) is multiplied by the extended multiplier operand, after multiplication the integer portion (fourth operand) is extracted and a 32 bit (EMODF) or 64 bit (EMODD) floating point number is formed from the fractional part of the product by truncating extra bits, the multiplication is such that the result is equivalent to the exact product truncated (before normalization) to a fraction field of 32 bits in floating or 64 bits in double (fifth operand); clears or sets flags
DIV Divide; DEC VAX; arithmetic division of scalar quantities (32, 64, or 128 bit floating point) in general purpose registers or memory, available in two operand (first operand [divisor] divided from second operand [dividend] with result [quotient] replacing second operand) and three operand (first operand [divisor] divided from second operand [dividend] with result placed in third operand [quotient]) (DIVF2 divide float 2 operand, DIVF3 divide float 3 operand, DIVD2 divide double float 2 operand, DIVD3 divide double float 3 operand, DIVG2 divide G float 2 operand, DIVG3 divide G float 3 operand, DIVH2 divide H float 2 operand, DIVH3 divide H float 3 operand); clears or sets flags
CMP Compare; DEC VAX; arithmetic comparison between two scalar quantities (8, 16, or 32 bit integer or 32 or 64 bit floating point) in general purpose registers or memory (CMPF Floating, CMPD Double Float); clears or sets flags
TST Test; DEC VAX; arithmetic comparison of a scalar quantities (8, 16, or 32 bit integer or 32 or 64 bit floating point) in general purpose registers or memory (TSTF Floating, TSTD Double Float) to zero; equivalent to CMPs src, #0, but shorter and executes faster; clears or sets flags
binary coded decimals
Binary coded decimal (BCD) is a method for implementing lossless decimal arithmetic (including decimal fractions) on a binary computer. The most obvious uses involve money amounts where round-off error from using binary approximations is unacceptable.
BCD arithmetic includes BCD addition, BCD subtraction, BCD multiplication, BCD division, and BCD negate.
The Intel 80x86 series uses a two step approach for BCD arithmetic. Instead of having separate BCD instructions, the normal binary addition and subtraction instructions are used, then hardware instructions are used to adjust the results to correct BCD results. There are instuctions for both packed and unpacked adjustments.
Pack (Motorola 680x0) converts byte encoded numeric data (such as ASCII or EBCDIC characters) into binary coded decimals. Unpack (Motorola 680x0) converts binary coded decimals into byte encoded numeric data (such as ASCII or EBCDIC characters). The ASCII adjustment field is $3030; the EBCDIC adjustment field is $F0F0.
ABCD Add Decimal with Extend; Motorola 680x0, Motorola 68300; performs binary coded decimal addition of source plus destination plus extend bit, source and destination can be two data registers or two locations in memory with the two address pointer registers being predecremented; sets or clears flags
SBCD Subtract Decimal with Extend; Motorola 680x0; performs binary coded decimal subtraction of source and extend bit from destination, source and destination can be two data registers or two locations in memory with the two address pointer registers being predecremented; sets or clears flags
NBCD Negate Decimal with Extend; Motorola 680x0, Motorola 68300; performs tens complement of contents of a data register or memory location by performing decimal coded binary subtraction of destination and extend bit from zero; sets or clears flags
DAA Decimal Adjust after Addition; Intel 80x86; adjusts the result of adding two valid packed decimal operands in AL register; sets or clears flags
DAS Decimal Adjust after Subtraction; Intel 80x86; adjusts the result of subtracting two valid packed decimal operands in AL register; sets or clears flags
AAA ASCII Adjust after Addition; Intel 80x86; changes the contents of register AL to a valid unpacked decimal number, and zeros the top 4 bits; sets or clears flags
AAS ASCII Adjust after Subtraction; Intel 80x86; changes the contents of register AL to a valid unpacked decimal number, and zeros the top 4 bits; sets or clears flags
AAM ASCII Adjust after Multiplication; Intel 80x86; corrects the result of a multiplication of two valid unpacked decimal numbers, the high order digit is left in AH, the low order digit in AL; sets or clears flags
AAD ASCII Adjust before Division; Intel 80x86; modifies the numerator in AH and AL to prepare for the division of two valid unpacked decimal operands so that the quotient produced by the division will be a valid unpacked decimal number, AH should contain the high-order digit and AL the low-order digit, this instruction adjusts the value and places the result in AL, AH will contain zero.; sets or clears flags
PACK Pack; Motorola 680x0; converts converts byte encoded numeric data (such as ASCII or EBCDIC characters) into binary coded decimals using an adjustment field ($3030 for ASCII, $F0F0 for EBCDIC), either from data register to data register or memory location to memory location with predecrement of address pointers; does not modify flags
UNPK Unpack; Motorola 680x0; converts converts converts binary coded decimals into byte encoded numeric data (such as ASCII or EBCDIC characters) using an adjustment field ($3030 for ASCII, $F0F0 for EBCDIC), either from data register to data register or memory location to memory location with predecrement of address pointers; does not modify flags
advanced math operations
EMOD Extended Multiply and Integerize; DEC VAX; performs accurate range reduction of math function arguments, the floating point multiplier extension operand (second operand) is concatenated with the floating point multiplier (first operand) to gain eight additional low order fraction bits, the multiplicand operand (third operand) is multiplied by the extended multiplier operand, after multiplication the integer portion (fourth operand) is extracted and a 32 bit (EMODF) or 64 bit (EMODD) floating point number is formed from the fractional part of the product by truncating extra bits, the multiplication is such that the result is equivalent to the exact product truncated (before normalization) to a fraction field of 32 bits in floating or 64 bits in double (fifth operand); clears or sets flags
TBLS Table Lookup and Interpolate (Signed, Rounded); Motorola 68300; signed lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) + {(ENTRY(n+1) - ENTRY(n)) * Dx[7:0]} / 256 into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) is subtracted from the next consecutive table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is subtracted from the second data register-based table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; rounding is selected by the R instruction field, for a rounding adjustment of -1, 0, or +1; sets or clears flags
TBLSN Table Lookup and Interpolate (Signed, Not Rounded); Motorola 68300; signed lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) * 256 + (ENTRY(n+1) - ENTRY(n)) * Dx[7:0] into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) multiplied by 256, then added to the value determined by (selected table entry subtracted from the next consecutive table entry, then multiplied by the interpolation fraction), and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is multiplied by 256, then added to the value determined by (first data register-based table entry subtracted from the second data register-based table entry, then multiplied by the interpolation fraction), and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; sets or clears flags
TBLU Table Lookup and Interpolate (Unsigned, Rounded); Motorola 68300; unsigned lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) + {(ENTRY(n+1) - ENTRY(n)) * Dx[7:0]} / 256 into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) is subtracted from the next consecutive table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is subtracted from the second data register-based table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; rounding is selected by the R instruction field, for a rounding adjustment of 0 or +1; sets or clears flags
TBLUN Table Lookup and Interpolate (Unsigned, Not Rounded); Motorola 68300; unsigned lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) * 256 + (ENTRY(n+1) - ENTRY(n)) * Dx[7:0] into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) multiplied by 256, then added to the value determined by (selected table entry subtracted from the next consecutive table entry, then multiplied by the interpolation fraction), and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is multiplied by 256, then added to the value determined by (first data register-based table entry subtracted from the second data register-based table entry, then multiplied by the interpolation fraction), and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; sets or clears flags
POLY Polynomial Evaluation; DEC VAX; performs fast calculation of math functions, for degree times (second operand) evaluate a function using Horners method, where d=degree (second operand), x=argument (first operand), and result = C[0] + x*(C[1] + x*(C[2] + x*C[d])), float result stored in D0 register, double float result stored in D0:D1 register pair, the table address operand (third operand) points to a table of polynomial coefficients ordered from highest order term of the polynomial through lower order coefficients stored at increasing addresses, the data type of the coefficients must be the same as the data type of the argument operand (first operand), the unsigned word degree operand (second operand) specifies the highest numbered coefficient to participate in the evaluation (POLYF polynomial evaluation floating, POLYD polynomial evaluation double float); D0 through D4 registers modified by POLYF, D0 through D5 registers modified by POLYD; sets or clears flags
data conversion
Data conversion instructions change data from one format to another.
A sign extension operation takes a small value and sign extends it to a larger storage format (such as byte to word).
A type conversion operation changes data from one format to another (such as signed twos complement integer into binary coded decimal).
EXT Sign Extend; Motorola 680x0, Motorola 68300; sign extends a byte (8 bits) in a data register to a word (16 bits) or sign extends a word (16 bits) in a data register to a longword (32 bits); sets or clears flags
CVT Convert; DEC VAX; converts a signed quantity to a different signed data type, source and destination in register or memory, special rounded versions for certain floating conversions; sets or clears flags
CVTBW Convert Byte to Word; sign extend
CVTBL Convert Byte to Long; sign extend
CVTWB Convert Word to Byte; truncated
CVTWL Convert Word to Long; sign extend
CVTLB Convert Long to Byte; truncated
CVTLW Convert Long to Word; truncated
CVTBF Convert Byte to Floating; exact
CVTBD Convert Byte to Double float; exact
CVTWF Convert Word to Floating; exact
CVTWD Convert Word to Double float; exact
CVTLF Convert Long to Floating; rounded
CVTLD Convert Long to Double float; exact
CVTFB Convert Floating to Byte; truncated
CVTDB Convert Double float to Byte; truncated
CVTFW Convert Floating to Word; truncated
CVTDW Convert Double float to Word; truncated
CVTFL Convert Floating to Long; truncated
CVTRFL Convert Rounded Floating to Long; rounded
CVTDL Convert Double float to Long; truncated
CVTRDL Convert Rounded Double float to Long; rounded
CVTFD Convert Floating to Double float; exact
CVTDF Convert Double float to Floating; rounded
CBW Convert Byte to Word; Intel 80x86; sign extends a byte (8 bits) in register AL to create a word (16 bits) in the AX register; does not affect flags
CWD Convert Word to Doubleword; Intel 80x86; sign extends a word (16 bits) in register AX throughout the DX register to create a doubleword (32 bits); does not affect flags
CWDE Convert Word to Doubleword Extended; Intel 80386; sign extends a word (16 bits) in register AX to create a doubleword (32 bits) in the EAX register; does not affect flags
CDQ Convert Doubleword to Quadword; Intel 80386; sign extends a doubleword (32 bits) in register EAX to create a quadword (64 bits) in the EDX register; does not affect flags
EXTB Sign Extend Byte; Motorola 680x0, Motorola 68300; sign extends a byte (8 bits) in a data register to a longword (32 bits); sets or clears flags
MOVSX Move with Sign Extension; Intel 80x86; moves data from a register or memory to a register, with a sign extension (conversion to larger binary integer: byte to word, byte to doubleword, or word to doubleword); does not affect flags
MOVZX Move with Zero Extension; Intel 80x86; moves data from a register or memory to a register, with a zero extension (conversion to larger binary integer: byte to word, byte to doubleword, or word to doubleword); does not affect flags
MOVZ Move Zero Extended; DEC VAX; converts an unsigned integer to a larger unsigned integer, source and destination in register or memory (MOVZBW Byte to Word, MOVZBL Byte to Long, MOVZWL Word to Long); sets or clears flags
NUM Convert to Numeric; MIX; converts byte encoded character code (MIX character code) in A-register/X-register pair to numeric data in the A-register (accumulator), does not change sign, overflow possible
CHAR Convert to Characters; MIX; converts numeric data in the A-register (accumulator) into byte encoded character code (MIX character code) in A-register/X-register pair, does not change signs
PACK Pack; Motorola 680x0; converts byte encoded numeric data (such as ASCII or EBCDIC characters) into binary coded decimals using an adjustment field ($3030 for ASCII, $F0F0 for EBCDIC), either from data register to data register or memory location to memory location with predecrement of address pointers; does not modify flags
UNPK Unpack; Motorola 680x0; converts binary coded decimals into byte encoded numeric data (such as ASCII or EBCDIC characters) using an adjustment field ($3030 for ASCII, $F0F0 for EBCDIC), either from data register to data register or memory location to memory location with predecrement of address pointers; does not modify flags
logical
Logical instructions typically work on a bit by bit basis, although some processors use the entire contents of the operands as whole flags (zero or not zero input, zero or negative one output). Typical logical operations include logical negation or logical complement (NOT), logical and (AND), logical inclusive or (OR or IOR), and logical exclusive or (XOR or EOR). Logical tests are a comparison of a value to a bit string (or operand treated as a bit string) of all zeros. Some processors have an instruction that sets or clears a bit or byte in registers or memory based on the processor condition codes.
NOT Logical Complement; Motorola 680x0, Motorola 68300; calculates the ones complement (logical negation) of the contents of memory or a register (8, 16, or 32 bits); sets or clears flags
NOT One's Complement Negation; Intel 80x86; calculates the ones complement (logical negation) of the contents of memory or a register (8, 16, or 32 bits); does not modify flags
AND And Logical; Motorola 680x0, Motorola 68300; performs a logical AND of a source operand with a destination operand and stores the result in the destination operand (8, 16, or 32 bits), one of the two operands must be a data register, the other operand can be the contents of any register or memory location; sets or clears flags
ANDI And Immediate; Motorola 680x0, Motorola 68300; performs a logical AND of the contents of a register or memory location (8, 16, or 32 bits) with an immediate; sets or clears flags
AND Logical AND; Intel 80x86; performs a logical AND between two registers, a register and contents of a memory location, or an immediate operand and either the contents of a register or the contents of a memory location; byte (8 bits), word (16 bits), or doubleword (32 bits); sets or clears flags
OR Inclusive Or Logical; Motorola 680x0, Motorola 68300; performs a logical inclusive OR of a source operand with a destination operand and stores the result in the destination operand (8, 16, or 32 bits), one of the two operands must be a data register, the other operand can be the contents of any register or memory location; sets or clears flags
ORI Inclusive Or Immediate; Motorola 680x0, Motorola 68300; performs a logical inclusive OR of the contents of a register or memory location (8, 16, or 32 bits) with an immediate; sets or clears flags
OR Logical Inclusive OR; Intel 80x86; performs a logical OR between two registers, a register and contents of a memory location, or an immediate operand and either the contents of a register or the contents of a memory location; byte (8 bits), word (16 bits), or doubleword (32 bits); sets or clears flags
BIS Bit Set; DEC VAX; performs a logical inclusive OR of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (BISB2 bit set byte 2 operand, BISB3 bit set byte 3 operand, BISW2 bit set word 2 operand, BISW3 bit set word 3 operand, BISL2 bit set longword 2 operand, BISL3 bit set longword 3 operand); sets or clears flags
XOR Exclusive OR; DEC VAX; performs a logical exclusive OR of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (XORB2 exclusive or byte 2 operand, XORB3 exclusive or byte 3 operand, XORW2 exclusive or word 2 operand, XORW3 exclusive or word 3 operand, XORL2 exclusive or longword 2 operand, XORL3 exclusive or longword 3 operand); sets or clears flags
EOR Exclusive Or Logical; Motorola 680x0, Motorola 68300; performs a logical exclusive or (XOR) of a source operand with a destination operand and stores the result in the destination operand (8, 16, or 32 bits), one of the two operands must be a data register, the other operand can be the contents of any register or memory location; sets or clears flags
EORI Exclusive Or Immediate; Motorola 680x0, Motorola 68300; performs a logical exclusive or (XOR) of the contents of a register or memory location (8, 16, or 32 bits) with an immediate; sets or clears flags
XOR Logical Exclusive OR; Intel 80x86; performs a logical exclusive OR between two registers, a register and contents of a memory location, or an immediate operand and either the contents of a register or the contents of a memory location; byte (8 bits), word (16 bits), or doubleword (32 bits); sets or clears flags
BIC Bit Clear; DEC VAX; performs a complimented logical AND of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (BICB2 bit clear byte 2 operand, BICB3 bit clear byte 3 operand, BICW2 bit clear word 2 operand, BICW3 bit clear word 3 operand, BICL2 bit clear longword 2 operand, BICL3 bit clear longword 3 operand); sets or clears flags
BIC Bit Clear; DEC VAX; performs a complimented logical AND of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (BICB2 bit clear byte 2 operand, BICB3 bit clear byte 3 operand, BICW2 bit clear word 2 operand, BICW3 bit clear word 3 operand, BICL2 bit clear longword 2 operand, BICL3 bit clear longword 3 operand); sets or clears flags
TST Test an Operand; Motorola 680x0, Motorola 68300; compares the contents of a register or memory location (8, 16, or 32 bits) with zero; sets or clears flags
TEST Logical Compare; Intel 80x86; compares the contents of a register or memory location (8, 16, or 32 bits) with an immediate value or the contents of a register; sets or clears flags
BIT Bit Test; DEC VAX; performs a logical AND of the bit mask (first operand, register or memory) with the source (second operand, register or memory) without modifying either operand and tests the resulting bits for being all zero (BITB byte, BITW word, BITL longword); sets or clears flags
Scc Set According to Condition; Motorola 680x0, Motorola 68300; tests a condition code, if the condition is true then sets a byte (8 bits) of a data register or memory location to TRUE (all ones), if the condition is false then sets a byte (8 bits) of a data register or memory location to FALSE (all zeros): SCC, SCS, SEQ, SF, SGE, SGT, SHI, SLE, SLS, SLT, SMI, SNE, SPL, ST, SVC, SVS
SETcc Set Byte on Condition cc; Intel 80x86; tests a condition code, if the condition is true then sets a byte (8 bits) of a data register or memory location to TRUE (all ones), if the condition is false then sets a byte (8 bits) of a data register or memory location to FALSE (all zeros): SETA, SETAE, SETB, SETBE, SETC, SETE, SETG, SETGE, SETL, SETLE, SETNA, SETNAE, SETNB, SETNBE, SETNC, SETNE, SETNG, SETNGE, SETNL, SETNLE, SETNO, SETNP, SETNS, SETNZ, SETO, SETP, SETPE, SETPO, SETS, SETZ
shift and rotate
Shift and rotate instructions move bit strings (or operand treated as a bit string).
Shift instructions move a bit string (or operand treated as a bit string) to the right or left, with excess bits discarded (although one or more bits might be preserved in flags). In arithmetic shift left or logical shift left zeros are shifted into the low-order bit. In arithmetic shift right the sign bit (most significant bit) is shifted into the high-order bit. In logical shift right zeros are shifted into the high-order bit.
Rotate instructions are similar to shift instructions, ecept that rotate instructions are circular, with the bits shifted out one end returning on the other end. Rotates can be to the left or right. Rotates can also employ an extend bit for multi-precision rotates.
A swap instruction swaps the high and low order portions of a register or contents of a series of memory locations.
The carry bit typically receives the last bit shifted out of the operand. Sometimes an extend bit will receive the last bit shifted out also. Somtimes an overflow bit is used to indicate a sign change has occurred.
ASH Arithmetic Shift; DEC VAX; performs a bit shift on a longword or quadword, the first operand is a byte count, the second operand is the source longword or quadword in registers or memory, the third operand is the destination longword or quadword in registers or memory, positive counts causes a left shift with zeros entering in the least significant bits, negative count causes a right shift with the most significant bit being copied into the most significant bit, a zero count results in the destination being replaced by the unmodified source (ASHL arithmetic shift longword, ASHQ arithmetic shift quadword); sets or clears flags
ASL Arithmetic Shift Left; Motorola 680x0, Motorola 68300; shifts the contents of a data register (8, 16, or 32 bits) or memory location (16 bits) to the left (towards most significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the high-order bit being shifted into the carry and extend flags, zeros shifted into the low-order bit, overflow flag indicating a change of sign; sets or clear flags
SAL Shift Arithmetic Left; Intel 80x86; shifts the contents of a data register or memory location (8, 16, or 32 bits) to the left (towards most significant bit) by a specified amount (by 1, by 0 to 31 bits specified by an immediate operand, or by 0-31 bits specified by the contents of the CL register), with the high-order bit being shifted into the carry flag, zeros shifted into the low-order bit; sets or clear flags
ASR Arithmetic Shift Right; Motorola 680x0, Motorola 68300; shifts the contents of a data register (8, 16, or 32 bits) or memory location (16 bits) to the right (towards the least significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the low-order bit being shifted into the carry and extend flags, the original high-order bit being replicated and shifted into the high-order bit; sets or clear flags
SAR Shift Arithmetic Right; Intel 80x86; shifts the contents of a data register or memory location (8, 16, or 32 bits) to the right (towards least significant bit) by a specified amount (by 1, by 0 to 31 bits specified by an immediate operand, or by 0-31 bits specified by the contents of the CL register), with the low-order bit being shifted into the carry flag, the original high-order bit being replicated and shifted into the high-order bit; sets or clear flags
SLA Shift Left A-register; MIX; byte shift the contents of the A-register (leaving sign unchanged) to the left by the designated number of bytes, with zeros shifted in to low order bytes
SLAX Shift Left AX-register; MIX; byte shift the contents of the A-register and X-register pair (leaving signs unchanged) to the left by the designated number of bytes, with zeros shifted in to low order bytes
LSL Logical Shift Left; Motorola 680x0, Motorola 68300; shifts the contents of a data register (8, 16, or 32 bits) or memory location (16 bits) to the left (towards most significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the high-order bit being shifted into the carry and extend flags, zeros shifted into the low-order bit; sets or clear flags
SHL Shift Logical Left; Intel 80x86; shifts the contents of a data register or memory location (8, 16, or 32 bits) to the left (towards most significant bit) by a specified amount (by 1, by 0 to 31 bits specified by an immediate operand, or by 0-31 bits specified by the contents of the CL register), with the high-order bit being shifted into the carry flag, zeros shifted into the low-order bit; sets or clear flags
SRA Shift Right A-register; MIX; byte shift the contents of the A-register (leaving sign unchanged) to the right by the designated number of bytes, with zeros shifted in to high order bytes
SRAX Shift Right AX-register; MIX; byte shift the contents of the A-register and X-register pair (leaving signs unchanged) to the right by the designated number of bytes, with zeros shifted in to high order bytes
LSR Logical Shift Right; Motorola 680x0, Motorola 68300; shifts the contents of a data register (8, 16, or 32 bits) or memory location (16 bits) to the right (towards the least significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the low-order bit being shifted into the carry and extend flags, and zeros shifted into the high-order bit; sets or clear flags
SHR Shift Logical Right; Intel 80x86; shifts the contents of a data register or memory location (8, 16, or 32 bits) to the right (towards least significant bit) by a specified amount (by 1, by 0 to 31 bits specified by an immediate operand, or by 0-31 bits specified by the contents of the CL register), with the low-order bit being shifted into the carry flag, and zeros shifted into the high-order bit; sets or clear flags
SHLD Double Precision Shift Left; Intel 80x86; shifts the contents of a general purpose register (16 or 32 bits) to the left (towards most significant bit) by a specified amount (by 0 to 31 bits specified by an immediate operand or by 0-31 bits specified by the contents of the CL register) with the high-order bits being shifted into a general purpose register or memory location (the source register is unchanged); used to implement multiprecision shifts, bit blts (BIT BLock Transfers), or bit string extracts and inserts; sets or clear flags
SHRD Double Precision Shift Right; Intel 80x86; shifts the contents of a general purpose register (16 or 32 bits) to the right (towards least significant bit) by a specified amount (by 0 to 31 bits specified by an immediate operand or by 0-31 bits specified by the contents of the CL register) with the low-order bits being shifted into a general purpose register or memory location (the source register is unchanged); used to implement multiprecision shifts, bit blts (BIT BLock Transfers), or bit string extracts and inserts; sets or clear flags
ROTL Rotate Long; DEC VAX; performs a bit rotate on a longword, the first operand is a byte count, the second operand is the source longword in registers or memory, the third operand is the destination longword in registers or memory, positive counts causes a left rotate, negative count causes a right rotate, a zero count results in the destination being replaced by the unmodified source, bits shifted out one end are rotated back in the other end; sets or clears flags
ROL Rotate Left; Motorola 680x0, Motorola 68300; rotates the contents of a data register (8, 16, or 32 bits) or a memory location (16 bits) to the left (towards the most significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the high-order bit rotating into both the carry flag and the low-order bit; sets or clear flags
ROL Rotate Left; Intel 80x86; rotates the contents of a general purpose register or a memory location (8, 16, or 32 bits) to the left (towards the most significant bit) by a specified amount (by 1 bit or by 0 to 31 bits specified by an immediate operand or by the contents of the CL register); sets or clear flags
SLC Shift Left AX-register Circularly; MIX; byte shift the contents of the A-register and X-register pair (leaving signs unchanged) to the left by the designated number of bytes, with bytes shifted off low order end entering on high order end
ROR Rotate Right; Motorola 680x0, Motorola 68300; rotates the contents of a data register (8, 16, or 32 bits) or a memory location (16 bits) to the right (towards the least significant bit) by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the low-order bit rotating into both the carry flag and the high-order bit; sets or clear flags
ROR Rotate Right; Intel 80x86; rotates the contents of a general purpose register or a memory location (8, 16, or 32 bits) to the right (towards the least significant bit) by a specified amount (by 1 bit or by 0 to 31 bits specified by an immediate operand or by the contents of the CL register); sets or clear flags
SRC Shift Right AX-register Circularly; MIX; byte shift the contents of the A-register and X-register pair (leaving signs unchanged) to the right by the designated number of bytes, with bytes shifted off high order end entering on low order end
ROXL Rotate Left with Extend; Motorola 680x0, Motorola 68300; rotates the contents of a data register (8, 16, or 32 bits) or a memory location (16 bits) to the left (towards the most significant bit) through the extend bit by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the high-order bit rotating into both the carry flag and the extend bit and the extend bit rotating into the low-order bit; sets or clear flags
RCL Rotate Through Carry Left; Intel 80x86; rotates the contents of a general purpose register or a memory location (8, 16, or 32 bits) to the left (towards the most significant bit) by a specified amount (by 1 bit or by 0 to 31 bits specified by an immediate operand or by the contents of the CL register) with the carry flag (CF) being treated as a high-order one-bit extension of the destination operand; sets or clear flags
ROXR Rotate Right with Extend; Motorola 680x0, Motorola 68300; rotates the contents of a data register (8, 16, or 32 bits) or a memory location (16 bits) to the right (towards the least significant bit) through the extend bit by a specified amount (by 1 to 8 bits for an immediate operation on a data register, by the contents of a data register modulo 64 for a data register, or by 1 bit only for a memory location), with the low-order bit rotating into both the carry flag and the extend bit and the extend bit rotating into the high-order bit; sets or clear flags
RCR Rotate Through Carry Right; Intel 80x86; rotates the contents of a general purpose register or a memory location (8, 16, or 32 bits) to the right (towards the least significant bit) by a specified amount (by 1 bit or by 0 to 31 bits specified by an immediate operand or by the contents of the CL register) with the carry flag (CF) being treated as as a low-order one-bit extension of the destination operand; sets or clear flags
SWAP Swap; Motorola 680x0, Motorola 68300; exchanges the high order word (16 bits) with the low order word (16 bits) of a data register; sets or clears flags
bit manipulation
Bit manipulation instructions manipulate a specific bit of a bit string (or operand treated as a bit string). Bit clear changes the specified bit to zero. Bit set changes the specified bit to one. Bit change modifies a specified bit, clearing a one bit to zero and setting a zero bit to one. In some processors, the value of the bit before modification is tested. Bit test examines the value of a specified bit.
Bit scan instructions search a bit string for the first bit that is set or cleared (depending on the processor).
BTST Bit Test; Motorola 680x0, Motorola 68300; tests the value of a specified bit in a register or memory location (8 bit memory operands, 32 bit register operands); sets or clears flags
BIT Bit Test; Intel 80x86; tests the value of a specified bit in a general register or memory location; sets or clears flags
BCLR Bit Test and Clear; Motorola 680x0, Motorola 68300; tests the value of a specified bit in a register or memory location (8 bit memory operands, 32 bit register operands), then clears the specified bit to zero; sets or clears flags
BTR Bit Test and Reset; Intel 80x86; tests the value of a specified bit in a general register or memory location, then clears (resets) the specified bit to one; sets or clears flags
BSET Bit Test and Set; Motorola 680x0, Motorola 68300; tests the value of a specified bit in a register or memory location (8 bit memory operands, 32 bit register operands), then sets the specified bit to one; sets or clears flags
BTS Bit Test and Set; Intel 80x86; tests the value of a specified bit in a general register or memory location, then sets the specified bit to one; sets or clears flags
BCHG Bit Test and Change; Motorola 680x0, Motorola 68300; tests the value of a specified bit in a register or memory location (8 bit memory operands, 32 bit register operands), then either clears a one bit to zero or sets a zero bit to one; sets or clears flags
BTC Bit Test and Complement; Intel 80x86; tests the value of a specified bit in a general register or memory location, then complements; sets or clears flags
BSF Bit Scan Forward; Intel 80x86; scans a word (16 bits) or doubleword (32 bits) in memory or a general register from low-order to high-order (starting from bit index zero) for a one-bit and store the index of the first set bit into a register (if no set bit is found, the value of the destination register is undefined); sets or clears flags
BSR Bit Scan Reverse; Intel 80x86; scans a word (16 bits) or doubleword (32 bits) in memory or a general register from high-order to low-order (starting from bit index 15 of a word or index 31 of a doubleword) for a one-bit and store the index of the first set bit into a register (if no set bit is found, the value of the destination register is undefined); sets or clears flags
bit field
Bit field instructions make modifications to bit fields (or operands treated as bit fields). Bit field insert inserts a value into a bit field. Bit field extract extracts a signed or unsigned value from a bit field. Bit field find first one finds the first bit that is set (one) in a bit field. Bit field test evaluates a bit field and sets or clears flags. Bit field test and setevaluates a bit field and set or clear flags then sets the bit field. Bit field test and clearevaluates a bit field and set or clear flags then clears the bit field. Bit field test and changeevaluates a bit field and set or clear flags then changes the bit field.
BFINS Bit Field Insert; Motorola 680x0; inserts a bit field (1 to 32 bits) from a data register to a location in data register or memory located by field offset and field width; sets or clears flags
BFEXTU Bit Field Extract Unsigned; Motorola 680x0; extracts an unsigned bit field (1 to 32 bits) in registers or memory located by field offset and field width and zero extends the field into a data register (32 bits); sets or clears flags
BFEXTS Bit Field Extract Signed; Motorola 680x0; extracts a signed bit field (1 to 32 bits) in registers or memory located by field offset and field width and sign extends the field into a data register (32 bits); sets or clears flags
BFFFO Bit Field Find First One; Motorola 680x0; searches a bit field (1 to 32 bits) in registers or memory located by field offset and field width for the most significant bit that is set to a value of one; set or clears flags
BFTST Bit Field Test; Motorola 680x0; sets condition codes according to the value of a bit field (1 to 32 bits) in registers or memory located by field offset and field width
BIT Bit Test; DEC VAX; performs a logical AND of the bit mask (first operand, register or memory) with the source (second operand, register or memory) without modifying either operand and tests the resulting bits for being all zero (BITB byte, BITW word, BITL longword); sets or clears flags
BFSET Test Bit Field and Set; Motorola 680x0; sets condition codes according to the value of a bit field (1 to 32 bits) in registers or memory located by field offset and field width, then sets the field; sets or clear flags
BIS Bit Set; DEC VAX; performs a logical inclusive OR of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (BISB2 bit set byte 2 operand, BISB3 bit set byte 3 operand, BISW2 bit set word 2 operand, BISW3 bit set word 3 operand, BISL2 bit set longword 2 operand, BISL3 bit set longword 3 operand); sets or clears flags
BFCLR Test Bit Field and Clear; Motorola 680x0; ; sets condition codes according to the value of a bit field (1 to 32 bits) in registers or memory located by field offset and field width, then clears the field; sets or clear flags
BIC Bit Clear; DEC VAX; performs a complimented logical AND of the bit mask (first operand, register or memory) with the source (second operand, register or memory), available in two operand (results stored in second operand) and three operand (results stored in third operand) (BICB2 bit clear byte 2 operand, BICB3 bit clear byte 3 operand, BICW2 bit clear word 2 operand, BICW3 bit clear word 3 operand, BICL2 bit clear longword 2 operand, BICL3 bit clear longword 3 operand); sets or clears flags
BFCHG Test Bit Field and Change; Motorola 680x0; sets condition codes according to the value of a bit field (1 to 32 bits) in registers or memory located by field offset and field width, then complements the field; sets or clear flags
SHLD Double Precision Shift Left; Intel 80x86; shifts the contents of a general purpose register (16 or 32 bits) to the left (towards most significant bit) by a specified amount (by 0 to 31 bits specified by an immediate operand or by 0-31 bits specified by the contents of the CL register) with the high-order bits being shifted into a general purpose register or memory location (the source register is unchanged); used to implement multiprecision shifts, bit blts (BIT BLock Transfers), or bit string extracts and inserts; sets or clear flags
SHRD Double Precision Shift Right; Intel 80x86; shifts the contents of a general purpose register (16 or 32 bits) to the right (towards least significant bit) by a specified amount (by 0 to 31 bits specified by an immediate operand or by 0-31 bits specified by the contents of the CL register) with the low-order bits being shifted into a general purpose register or memory location (the source register is unchanged); used to implement multiprecision shifts, bit blts (BIT BLock Transfers), or bit string extracts and inserts; sets or clear flags
BSF Bit Scan Forward; Intel 80x86; scans a word (16 bit) or doubleword (32 bit) bit string for the first set (one) bit; scans from low-order to high-order (starting from bit index zero); sets or clears flags
BSR Bit Scan Reverse; Intel 80x86; scans a word (16 bit) or doubleword (32 bit) bit string for the first set (one) bit; scans from high-order to low-order (starting from bit index 15 of a word or index 31 of a doubleword); sets or clears flags
table operations
TBLS Table Lookup and Interpolate (Signed, Rounded); Motorola 68300; signed lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) + {(ENTRY(n+1) - ENTRY(n)) * Dx[7:0]} / 256 into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) is subtracted from the next consecutive table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is subtracted from the second data register-based table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; rounding is selected by the R instruction field, for a rounding adjustment of -1, 0, or +1; sets or clears flags
TBLSN Table Lookup and Interpolate (Signed, Not Rounded); Motorola 68300; signed lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) * 256 + (ENTRY(n+1) - ENTRY(n)) * Dx[7:0] into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) multiplied by 256, then added to the value determined by (selected table entry subtracted from the next consecutive table entry, then multiplied by the interpolation fraction), and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is multiplied by 256, then added to the value determined by (first data register-based table entry subtracted from the second data register-based table entry, then multiplied by the interpolation fraction), and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; sets or clears flags
TBLU Table Lookup and Interpolate (Unsigned, Rounded); Motorola 68300; unsigned lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) + {(ENTRY(n+1) - ENTRY(n)) * Dx[7:0]} / 256 into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) is subtracted from the next consecutive table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is subtracted from the second data register-based table entry, then multiplied by the interpolation fraction, then divided by 256, then added to the first table entry, and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; rounding is selected by the R instruction field, for a rounding adjustment of 0 or +1; sets or clears flags
TBLUN Table Lookup and Interpolate (Unsigned, Not Rounded); Motorola 68300; unsigned lookup and interpolation of independent variable X from a compressed linear data table or between two register-based table entries of linear representations of dependent variable Y as a function of X; ENTRY(n) * 256 + (ENTRY(n+1) - ENTRY(n)) * Dx[7:0] into Dx; table version: data register low word contains the independent variable X, 8-bit integer part and 8-bit fractional part with assumed radix point located between bits 7 and 8, source effective address points to beginning of table in memory, integer part scaled to data size (byte, word, or longword) and used as offset from beginning of table, selected table entry (a linear representation of dependent variable Y) multiplied by 256, then added to the value determined by (selected table entry subtracted from the next consecutive table entry, then multiplied by the interpolation fraction), and then stored in the data register; register version: data register low byte contains the independent variable X 8-bit fractional part with assumed radix point located between bits 7 and 8, two data registers contain the byte, word, or longword table entries (a linear representation of dependent variable Y), first data register-based table entry is multiplied by 256, then added to the value determined by (first data register-based table entry subtracted from the second data register-based table entry, then multiplied by the interpolation fraction), and then stored in the destination (X) data register, the register interpolation mode may be used with several table lookup and interpolations to model multidimentional functions; sets or clears flags
high level language support
Many processors have instructions designed to support constructs common in high level languages. Ironically, a few high level language constructs have been based on specific hardware instructions on specific processors. One famous example is the computed GOTO (three possible branches based on whether the tested value is positive, zero, or negative), which is based on a hardware instruction in an early IBM processor (and if anyone can loan or give me a data book on the processor, I sure would appreciate it).
Most modern processors have some kind of loop instructions. These are some variation on the theme of testing for a condition and/or making a count with a short branch back to complete a loop if the exit condition fails.
Many modern processors have some kind of hardware support for temporary data storage (for the temporary variables used in subroutines and functions), combining special hardware instructions with argument and/or frame and/or stack pointers.
Bounds check instructions are used to check if an array reference is out of bounds.
CMP2 Compare Register Against Bounds; Motorola 680x0, Motorola 68300; compares the contents of register (8, 16, or 32 bits) to a bounds pair (lower bound followed by upper bound), if both bounds are equal then this operation tests for a specific value; sets or clears flags
BOUND Check Array Index Against Bounds; Intel 80x86; compares the contents of register (16 or 32 bits) to a bounds pair (lower bound followed by upper bound) in memory (source register contains address in memory of the first of two consecutive bounds), if the check fails, then an Interrupt 5 occurs; does not modify flags
DBcc Test Condition, Decrement, and Branch; Motorola 680x0, Motorola 68300; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, starts by testing a designated condition, if the test is true then no additional action is taken and the program continues to the next instruction (exiting the loop), if the test is false then the designated data register is decremented, if the result is exactly -1 then the program continues to the next instruction (exiting the loop), otherwise the program makes a short (16 bit) branch to continue the loop: DBCC, DBCS, DBEQ, DBF, DBGE, DBGT, DBHI, DBLE, DBLS, DBLT, DBMI, DBNE, DBPL, DBT, DBVC, DBVS
LOOP Loop While ECX Not Zero; Intel 80x86; used to implement DO loops, decrements the ECX or CX (count) register and then tests to see if it is zero, if the ECX or CX register is zero then the program continues to the next instruction (exiting the loop), otherwise the program makes a byte branch to contine the loop; does not modify flags
LOOPE Loop While Equal; Intel 80x86; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, decrements the ECX or CX (count) register and then tests to see if it is zero, if the ECX or CX register is zero or the Zero Flag is clear (zero) then the program continues to the next instruction (to exit the loop), otherwise the program makes a byte branch (to continue the loop); equivalent to LOOPZ; does not modify flags
LOOPNE Loop While Not Equal; Intel 80x86; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, decrements the ECX or CX (count) register and then tests to see if it is zero, if the ECX or CX register is zero or the Zero Flag is set (one) then the program continues to the next instruction (to exit the loop), otherwise the program makes a byte branch (to continue the loop); equivalent to LOOPNZ; does not modify flags
LOOPNZ Loop While Not Zero; Intel 80x86; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, decrements the ECX or CX (count) register and then tests to see if it is zero, if the ECX or CX register is zero or the Zero Flag is set (one) then the program continues to the next instruction (to exit the loop), otherwise the program makes a byte branch (to continue the loop); equivalent to LOOPNE; does not modify flags
LOOPZ Loop While Zero; Intel 80x86; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, decrements the ECX or CX (count) register and then tests to see if it is zero, if the ECX or CX register is zero or the Zero Flag is clear (zero) then the program continues to the next instruction (to exit the loop), otherwise the program makes a byte branch (to continue the loop); equivalent to LOOPE; does not modify flags
LINK Link Stack; Motorola 680x0, Motorola 68300
UNLK Unlink Stack; Motorola 680x0, Motorola 68300
program control
Program control instructions change or modify the flow of a program.
The most basic kind of program control is the unconditional branch or unconditional jump. Branch is usually an indication of a short change relative to the current program counter. Jump is usually an indication of a change in program counter that is not directly related to the current program counter (such as a jump to an absolute memory location or a jump using a dynamic or static table), and is often free of distance limits from the current program counter.
The pentultimate kind of program control is the conditional branch or conditional jump. This gives computers their ability to make decisions and implement both loops and algorithms beyond simple formulas.
Most computers have some kind of instructions for subroutine call and return from subroutines.
There are often instructions for saving and restoring part or all of the processor state before and after subroutine calls. Some kinds of subroutine or return instructions will include some kinds of save and restore of the processor state.
Even if there are no explicit hardware instructions for subroutine calls and returns, subroutines can be implemented using jumps (saving the return address in a register or memory location for the return jump). Even if there is no hardware support for saving the processor state as a group, most (if not all) of the processor state can be saved and restored one item at a time.
NOP, or no operation, takes up the space of the smallest possible instruction and causes no change in the processor state other than an advancement of the program counter and any time related changes. It can be used to synchronize timing (at least crudely). It is often used during development cycles to temporarily or permanently wipe out a series of instructions without having to reassemble the surrounding code.
Stop or halt instructions bring the processor to an orderly halt, remaining in an idle state until restarted by interrupt, trace, reset, or external action.
Reset instructions reset the processor. This may include any or all of: setting registers to an initial value, setting the program counter to a standard starting location (restarting the computer), clearing or setting interrupts, and sending a reset signal to external devices.
BRA Branch; Motorola 680x0, Motorola 68300; short (16 bit) unconditional branch relative to the current program counter
JMP Jump; Motorola 680x0, Motorola 68300; unconditional jump (any valid effective addressing mode other than data register)
JMP Jump; Intel 80x86; unconditional jump (near [relative displacement from PC] or far; direct or indirect [based on contents of general purpose register, memory location, or indexed])
JMP Jump; MIX; unconditional jump to location M; J-register loaded with the address of the instruction which would have been next if the jump had not been taken
JSJ Jump, Save J-register; MIX; unconditional jump to location M; J-register unchanged
Jcc Jump Conditionally; Intel 80x86; conditional jump (near [relative displacement from PC] or far; direct or indirect [based on contents of general purpose register, memory location, or indexed]) based on a tested condition: JA/JNBE, JAE/JNB, JB/JNAE, JBE/JNA, JC, JE/JZ, JNC, JNE/JNZ, JNP/JPO, JP/JPE, JG/JNLE, JGE/JNL, JL/JNGE, JLE/JNG, JNO, JNS, JO, JS
Bcc Branch Conditionally; Motorola 680x0, Motorola 68300; short (16 bit) conditional branch relative to the current program counter based on a tested condition: BCC, BCS, BEQ, BGE, BGT, BHI, BLE, BLS, BLT, BMI, BNE, BPL, BVC, BVS
JOV Jump on Overflow; MIX; conditional jump to location M if overflow toggle is on; if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken
JNOV Jump on No Overflow; MIX; conditional jump to location M if overflow toggle is off; if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken
Jcc Jump on Condition; MIX; conditional jump to location M based on comparison indicator; if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken; JL (less), JE (equal), JG (greater), JGE (greater-or-equal), JNE (unequal), JLE (less-or-equal)
JAcc Jump on A-register; MIX; conditional jump to location M based on A-register (accumulator); if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken; JAN (negative), JAZ (zero), JAP (positive), JANN (nonnegative), JANZ (nonzero, JAMP (nonpositive)
JXcc Jump on X-register; MIX; conditional jump to location M based on X-register (extension); if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken; JXN (negative), JXZ (zero), JXP (positive), JXNN (nonnegative), JXNZ (nonzero, JXMP (nonpositive)
Jicc Jump on I-register; MIX; conditional jump to location M based on one of five I-registers (index); if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken; JiN (negative), JiZ (zero), JiP (positive), JiNN (nonnegative), JiNZ (nonzero, JiMP (nonpositive)
DBcc Test Condition, Decrement, and Branch; Motorola 680x0, Motorola 68300; used to implement DO loops, WHILE loops, UNTIL loops, and similar constructs, starts by testing a designated condition, if the test is true then no additional action is taken and the program continues to the next instruction (exiting the loop), if the test is false then the designated data register is decremented, if the result is exactly -1 then the program continues to the next instruction (exiting the loop), otherwise the program makes a short (16 bit) branch (continueing the loop): DBCC, DBCS, DBEQ, DBF, DBGE, DBGT, DBHI, DBLE, DBLS, DBLT, DBMI, DBNE, DBPL, DBT, DBVC, DBVS
Scc Set According to Condition; Motorola 680x0, Motorola 68300; tests a condition code, if the condition is true then sets a byte (8 bits) of a data register or memory location to TRUE (all ones), if the condition is false then sets a byte (8 bits) of a data register or memory location to FALSE (all zeros): SCC, SCS, SEQ, SF, SGE, SGT, SHI, SLE, SLS, SLT, SMI, SNE, SPL, ST, SVC, SVS
BSR Branch to Subroutine; Motorola 680x0, Motorola 68300; pushes the address of the next instruction following the subroutine call onto the system stack, decrements the system stack pointer, and changes program flow to a location (8, 16, or 32 bits) relative to the current program counter
JSR Jump to Subroutine; Motorola 680x0, Motorola 68300; pushes the address of the next instruction following the subroutine call onto the system stack, decrements the system stack pointer, and changes program flow to the address specified (any valid effective addressing mode other than data register)
CALL Call Procedure; Intel 80x86; pushes the address of the next instruction following the subroutine call onto the system stack, decrements the system stack pointer, and changes program flow to the address specified (near [relative displacement from PC] or far; direct or indirect [based on contents of general purpose register or memory location])
RTS Return from Subroutine; Motorola 680x0, Motorola 68300; fetches the return address from the top of the system stack, increments the system stack pointer, and changes program flow to the return address
RET Return From Procedure; Intel 80x86; fetches the return address from the top of the system stack, increments the system stack pointer, and changes program flow to the return address; optional immediate operand added to the new top-of-stack pointer, effectively removing any arguments that the calling program pushed on the stack before the execution of the corresponding CALL instruction; possible change to lesser privilege
RTR Return and Restore Condition Codes; Motorola 680x0, Motorola 68300; transfers the value at the top of the system stack into the condition code register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer, and changes program flow to the return address
IRET Return From Interrupt; Intel 80x86; transfers the value at the top of the system stack into the flags register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer, and changes program flow to the return address; optional immediate operand added to the new top-of-stack pointer, effectively removing any arguments that the calling program pushed on the stack before the execution of the corresponding CALL instruction; possible change to lesser privilege
RTD Return and Deallocate; Motorola 680x0, Motorola 68300; fetches the return address from the top of the system stack, increments the system stack pointer by the specified displacement value (effectively deallocating temporary storage space from the stack), and changes program flow to the return address
RTE Return from Exception; Motorola 680x0, Motorola 68300; transfers the value at the top of the system stack into the status register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer by a displacement value designated by format mode (effectively deallocating temporary storage space from the stack, the amount of space varying by type of exception that occurred), and changes program flow to the return address; privileged instruction (supervisor state)
MOVEM Move Multiple; Motorola 680x0, Motorola 68300; move contents of a list of registers to memory or restore from memory to a list of registers
LM Load Multiple; IBM 360/370; RS format; moves a series of full words (32 bits) of data from memory to a series of general purpose registers; main storage to register only; does not affect condition code
STM STore Multiple; IBM 360/370; RS format; moves contents of a series of general purpose registers to a series of full words (32 bits) in memory; register to main storage only; does not affect condition code
PUSHA Push All Registers; Intel 80x86; move contents all 16-bit general purpose registers to memory pointed to by stack pointer (in the order AX, CX, DX, BX, original SP, BP, SI, and DI ); does not affect flags
PUSHAD Push All Registers; Intel 80386; move contents all 32-bit general purpose registers to memory pointed to by stack pointer (in the order EAX, ECX, EDX, EBX, original ESP, EBP, ESI, and EDI ); does not affect flags
POPA Pop All Registers; Intel 80x86; move memory pointed to by stack pointer to all 16-bit general purpose registers (except for SP); does not affect flags
POPAD Pop All Registers; Intel 80386; move memory pointed to by stack pointer to all 32-bit general purpose registers (except for ESP); does not affect flags
STJ Store jump-register; MIX; move word or partial word field of data; jump register to main storage only
NOP No Operation; Motorola 680x0, Motorola 68300; no change in processor state other than an advance of the program counter
NOP No Operation; MIX; no change in processor state other than an advance of the program counter
STOP Stop; Motorola 680x0, Motorola 68300; loads an immediate operand into the program status register (both user and supervisor portions), advances program counter to next instruction, and stops the processor from fetching and executing instructions; privileged instruction (supervisor state)
HLT Halt; MIX; stop machine, computer restarts on next instruction
LPSTOP Low Power Stop; Motorola 68300; loads an immediate operand into the program status register (both user and supervisor portions), advances program counter to next instruction, and stops the processor from fetchhing and executing instructions, the new interrupt mask is copied to the external bus interface (EBI), internal clocks are stopped, the processor remains stopped until a trace, higher interrupt than new mask, or reset exception occurs; privileged instruction (supervisor state)
condition codes
Condition codes are the list of possible conditions that can be tested during conditional instructions. Typical conditional instructions include: conditional branches, conditional jumps, and conditional subroutine calls. Some processors have a few additional data related conditional instructions, and some processors make every instruction conditional. Not all condition codes available for a processor will be implemented for every conditional instruction.
Zero is mathematically neither positive nor negative, but for processor condition codes, most processors treat zero as either a positive or a negative numbers. Processors that treat zero as a positive number include the Motorola 680x0 and Motorola 68300.
A above; Intel 80x86; unsigned conditional transfer; equivalent to NBE; (not carry flag and not zero flag)
AE above or equal; Intel 80x86; unsigned conditional transfer; equivalent to NB; (not carry flag
B below; Intel 80x86; unsigned conditional transfer; equivalent to NAE; (carry flag)
BE below or equal; Intel 80x86; unsigned conditional transfer; equivalent to NA; (carry flag or zero flag)
C carry; Intel 80x86; unsigned conditional transfer; (carry flag)
CC Carry Clear; Motorola 680x0, Motorola 68300; not carry flag
CS Carry Set; Motorola 680x0, Motorola 68300; carry flag
E equal; Intel 80x86; unsigned conditional transfer; equivalent to Z; (zero flag)
EQ Equal; Motorola 680x0, Motorola 68300; zero flag
F False (never true); Motorola 680x0, Motorola 68300; never
G greater; Intel 80x86; signed conditional transfer; equivalent to NLE; (not ((sign flag xor overflow flag) or zero flag))
GE Greater or Equal; Motorola 680x0, Motorola 68300; (negative flag and overflow flag) or (not negative flag and not overflow flag)
GE greater or equal; Intel 80x86; signed conditional transfer; equivalent to NL; (not (sign flag xor overflow flag))
GT Greater Than; Motorola 680x0, Motorola 68300; (negative flag and overflow flag and not zero flag) or (not negative flag and not overflow flag and not zero flag)
HI High; Motorola 680x0, Motorola 68300; not carry flag and not zero flag
L less; Intel 80x86; signed conditional transfer; equivalent to NGE; (sign flag xor overflow flag)
LE Less or Equal; Motorola 680x0, Motorola 68300; (zero flag) or (negative flag and not overflow flag) or (not negative flag and overflow flag)
LE less or equal; Intel 80x86; signed conditional transfer; equivalent to NG; ((sign flag xor overflow flag) or zero flag)
LS Low or Same; Motorola 680x0, Motorola 68300; carry flag or zero flag
LT Less Than; Motorola 680x0, Motorola 68300; (negative flag and not overflow flag) or (not negative flag and overflow flag)
MI Minus; Motorola 680x0, Motorola 68300; negative flag
NA not above; Intel 80x86; unsigned conditional transfer; equivalent to BE; (carry flag or zero flag)
NAE not above nor equal; Intel 80x86; unsigned conditional transfer; equivalent to B; (carry flag)
NB not below; Intel 80x86; unsigned conditional transfer; equivalent to AE; (not carry flag)
NBE not below nor equal; Intel 80x86; unsigned conditional transfer; equivalent to A; (not carry flag and not zero flag)
NE Not Equal; Motorola 680x0, Motorola 68300; not zero flag
NE not equal; Intel 80x86; unsigned conditional transfer; equivalent to NZ; (not zero flag)
NG not greater; Intel 80x86; signed conditional transfer; equivalent to LE; ((sign flag xor overflow flag) or zero flag)
NGE not greater nor equal; Intel 80x86; signed conditional transfer; equivalent to L; (sign flag xor overflow flag)
NL not less; Intel 80x86; signed conditional transfer; equivalent to GE; (not (sign flag xor overflow flag))
NLE not less nor equal; Intel 80x86; signed conditional transfer; equivalent to G; (not ((sign flag xor overflow flag) or zero flag))
NO not overflow; Intel 80x86; signed conditional transfer; (not overflow flag)
NP not parity; Intel 80x86; unsigned conditional transfer; equivalent to PO; (not parity flag)
NS not sign (positive or zero); Intel 80x86; signed conditional transfer; (not sign flag)
NZ not zero; Intel 80x86; unsigned conditional transfer; equivalent to NE; (not zero flag)
O overflow; Intel 80x86; signed conditional transfer; (overflow flag)
P parity; Intel 80x86; unsigned conditional transfer; equivalent to PE; (parity flag)
PE parity; Intel 80x86; unsigned conditional transfer; equivalent to P; (parity flag)
PL Plus; Motorola 680x0, Motorola 68300; not negative flag
PO parity odd; Intel 80x86; unsigned conditional transfer; equivalent to NP; (not parity flag)
S sign (negative); Intel 80x86; signed conditional transfer; (sign flag)
T True (always true); Motorola 680x0, Motorola 68300; always
VC Overflow Clear; Motorola 680x0, Motorola 68300; not overflow flag
VS Overflow Set; Motorola 680x0, Motorola 68300; overflow flag
Z zero; Intel 80x86; unsigned conditional transfer; equivalent to E; (zero flag)
input/output
Input/Output (I/O) instructions are used to input data from peripherals, output data to peripherals, or read/write input/output controls. Early computers used special hardware to handle I/O devices. The trend in modern computers is to map I/O devices in memory, allowing the direct use of any instruction that operates on memory for handling I/O.
IN Input; MIX; initiate transfer of information from the input device specified into consecutive locations starting with M, block size implied by unit
OUT Output; MIX; initiate transfer of information from consecutive locations starting with M to the output device specified, block size implied by unit
IOC Input-Output Control; MIX; initiate I/O control operation to be performed by designated device
JRED Jump Ready; MIX; Jump if specified unit is ready (completed previous IN, OUT, or IOC operation); if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken
JBUS Jump Busy; MIX; Jump if specified unit is not ready (not yet completed previous IN, OUT, or IOC operation); if jump occurs, J-register loaded with the address of the instruction which would have been next if the jump had not been taken
MIX devices
Information on the devices for the hypothetical MIX processors input/output instructions.
unit number
peripheral
block size
control
t
Tape unit no. i (0 i 7)
100 words
M=0, tape rewound; M < 0, skip back M records; M > 0, skip forward M records
d
Disk or drum unit no. d (8 d 15)
100 words
position device according to X-register (extension)
16
Card reader
16 words
17
Card punch
16 words
18
Printer
24 words
IOC 0(18) skips printer to top of following page
19
Typewriter and paper tape
14 words
paper tape reader: rewind tape
system control
System control instructions control some basic element of the system or processor state.
Many system control instructions are privileged, meaning that only certain trusted routines are allowed to use them. This is implemented by having privilege states. The most simple version is two states: user and supervisor states. The user state cant run any privileged instructions, while the supervisor state can run all instructions. Some processors have more than two privilege states, allowing greater granularity of freedom to increasingly trusted operations.
The most basic kind of system control instructions are those that modify the condition codes or user portion of a status register.
Closely related are instructions that modify an entire status word or status register. The more powerful version is a privileged instruction and includes access to portions of the status register that can control or modify other processes.
Machine control instructions directly affect the entire processor. Stop or halt instructions bring the processor to an orderly halt, remaining in an idle state until restarted by interrupt, trace, reset, or external action.
Reset instructions reset the processor. This may include any or all of: setting registers to an initial value, setting the program counter to a standard starting location (restarting the computer), clearing or setting interrupts, and sending a reset signal to external devices.
Trap generating instructions generate a system trap. This includes a transition to a privileged state and turns control over to a routine with supervisor permission. This allows user processes to communicate with and make requests of the operating system. Note that it is common for some parts of an operating system to run in normal user mode so as to limit potential damage if something goes wrong.
Memory management instructions control memory and how memory is mapped and accessed by user and system routines. These instructions are almost always privileged and vary greatly from processor to processor (although the general capabilities and effects are pretty standard).
MOVE <ea>, CCR Move to Condition Codes Register; Motorola 680x0, Motorola 68300; moves data from data register, memory, or immediate data to user condition codes register
MOVE CCR, <ea> Move from Condition Codes Register; Motorola 680x0, Motorola 68300; moves data from user condition codes register to data register or memory
ANDI #data, CCR And Immediate to Condition Codes Register; Motorola 680x0, Motorola 68300; logical AND of the immediate data with the user condition codes register
ORI #data, CCR Or Immediate to Condition Codes Register; Motorola 680x0, Motorola 68300; logical inclusive OR of the immediate data with the user condition codes register
EORI #data, CCR Exclusive Or Immediate to Condition Codes Register; Motorola 680x0, Motorola 68300; logical exclusive OR of the immediate data with the user condition codes register
MOVE <ea>, SR Move to Status Register; Motorola 680x0, Motorola 68300; moves data from data register, memory, or immediate data to entire status register; privileged instruction (supervisor state)
MOVE SR, <ea> Move from Status Register; Motorola 680x0, Motorola 68300; moves data from entire status register to data register or memory; privileged instruction (supervisor state)
ANDI #data, SR And Immediate to Status Register; Motorola 680x0, Motorola 68300; logical AND of the immediate data with the entire status register; privileged instruction (supervisor state)
ORI #data, SR Or Immediate to Status Register; Motorola 680x0, Motorola 68300; logical inclusive OR of the immediate data with the entire status register; privileged instruction (supervisor state)
EORI #data, SR Exclusive Or Immediate to Status Register; Motorola 680x0, Motorola 68300; logical exclusive OR of the immediate data with the entire status register; privileged instruction (supervisor state)
MOVE USP Move User Stack Pointer; Motorola 680x0, Motorola 68300; moves the contents of the user stack pointer to or from the specified address register; privileged instruction (supervisor state)
MOVEC Move Control Register; Motorola 680x0, Motorola 68300; moves the contents of the specified address or data register to the specified control register or moves the contents of the specified control register to the specified data or address register (zero filled to 32 bits), control registers: Source Function Code (SFC) register, Destination Function Code (DFC) register, Cache Control Register (CACR), User Stack Pointer (USP), Vector Base Register (VBR), Cache Address Register (CAAR), Master Stack Pointer (MSP), Interrupt Stack Pointer (ISP); privileged instruction (supervisor state)
MOVES Move Address Space; Motorola 680x0, Motorola 68300; moves information between address spaces (allowing data communication across process boundaries), either moving data (8, 16, or 32 bits) from a specified address or data register to a memory location in the address space specified by the destination fucntion code (DFC) register or moves date (8, 16, or 32 bits) from a memory location in the address space specified by the source function code (SFC) register to the specified data or address register; does not modify flags; privileged instruction (supervisor state)
STOP Stop; Motorola 680x0, Motorola 68300; loads an immediate operand into the program status register (both user and supervisor portions), advances program counter to next instruction, and stops the processor from fetchhing and executing instructions; privileged instruction (supervisor state)
LPSTOP Low Power Stop; Motorola 68300; loads an immediate operand into the program status register (both user and supervisor portions), advances program counter to next instruction, and stops the processor from fetchhing and executing instructions, the new interrupt mask is copied to the external bus interface (EBI), internal clocks are stopped, the processor remains stopped until a trace, higher interrupt than new mask, or reset exception occurs; privileged instruction (supervisor state)
RESET Reset External Devices; Motorola 680x0, Motorola 68300; asserts the NOT RESET signal for 512 clock periods, resetting all external devices, no internal changes other than incrementing program counter to the next instruction; privileged instruction (supervisor state)
RTE Return from Exception; Motorola 680x0, Motorola 68300; transfers the value at the top of the system stack into the status register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer by a displacement value designated by format mode (effectively deallocating temporary storage space from the stack, the amount of space varying by type of exception that occurred), and changes program flow to the return address; privileged instruction (supervisor state)
coprocessor and multiprocessor operations
Multiprocessor instructions are used to coordinate activity between multiple processors.
Some multiprocessor instructions are designed to allow the processors to communicate with each other. A test and set instruction is used to implement flags or semaphores between processors. A compare and swap instruction is used to implement more sophsticated communications between multiple processors (such as counters or queue pointers) or secure updates of shared system control data structures in a multi-processing environment. Interlocked instructions are used to update counters, flags, and semaphores while locking out any other processors or devices from changing or reading the memory location while it is being updated.
TAS Test and Set an Operand; Motorola 680x0; tests the current value of the operand at the effective address in memory or a data register (obviously, data register operands arent multiprocessor, but the instruction still works) and sets or clears the N (negative) and Z (zero) condition codes accordingly, then sets the high order bit of the operand to one; this operation uses a read-modify-write memory cycle that completes the operation without interruption; sets or clears flags
CAS Compare and Swap with Operand; Motorola 680x0; Compares the operand at an effective address in memory to a compare operand in a data register, if the operands are equal, the update operand is transferred from a data register to the original effective address, if the operands are unequal, the operand at the effective address is transferred to the data register that contained the compare operand; this operation uses a read-modify-write memory cycle that completes the operation without interruption; sets or clears flags
CAS2 Dual Operand Compare and Swap; Motorola 680x0; Compares the operand at an effective address in memory to a compare operand in a data register, if the operands are equal, compares the operand at a second effective address in memory to a second compare operand in a data register, if the second operand is also equal, the update operands are transferred from a data register to the pair of original effective addresses, if either pair of operands are unequal, the operands at the pair of effective addresses are transferred to the data registers that contained the compare operands; this operation uses a read-modify-write memory cycle that completes the operation without interruption; sets or clears flags
ADAWI Add Aligned Word Interlocked; DEC VAX; adds (16 bit integer) a source operand from a register or memory to a memory location that is word aligned while interlocking the memory location so that no other processor or device can read or write to the interlocked memory location, used to maintain operating system resource usage counts; and sets or clears flags
trap generating
Trap generating instructions generate an exception that transfer control from software (usually application programs) to the operating system.
Operating system traps provide a mechanism to change to higher privilege levels (if they exist on the processor) and usually include a mechanism for identifying what kind of trap has occurred. This allows application programs to make requests of the operating system and may provide a hardware mechanism for switching from a user mode to a superviser, kernel, or other higher privilege level for the operating system response to the request.
A breakpoint instruction is used with external debugging hardware. The breakpoint instruction replaces an ordinary instruction (or the first part of an instruction) and relies on external debugging hardware to supply the missing instruction (or part of an instruction).
Various check instructions will test for conditions, trapping if the test fails. One common example is a check against bounds or limits.
Most processors have one or more illegal instructions. These are usually instructions that havent been implemented yet or instructions that have been dropped from a processor line. Many processors generate a trap or exception upon encountering an illegal instruction. Some processors will execute illegal instructions, which can lead to undocumented operations. Undocumented operations tend to change from one batch of processors to another and are highly unreliable. Some processors reserve an opcode that is guaranteed to always be illegal and always generate a trap or exception.
TRAP Trap; Motorola 680x0, Motorola 68300; generates a trap exception with a trap vector (32 plus an immediate value in the range of 0 to 15); does not modify flags
TRAPcc Trap on Condition; Motorola 680x0, Motorola 68300; if the tested condition is ture, generates a trap exception with vector 7, with optional word (16-bits) or longword (32-bits) immediate operand being available for the software trap handler: TRAPCC, TRAPCS, TRAPEQ, TRAPF, TRAPGE, TRAPGT, TRAPHI, TRAPLE, TRAPLS, TRAPLT, TRAPMI, TRAPNE, TRAPPL, TRAPT, TRAPVC, TRAPVS
Axxx A-line Trap; Motorola 680x0, Motorola 68300; generates an a-line trap with the 12 bit value in the byte and a half of the instruction word used as a vector into a trap table; reserved for use by computer hardware manufacturers to provide software routines or implement supporting hardware features (used in the Macintosh to provide operating system calls); does not modify flags
BKPT Breakpoint; Motorola 680x0, Motorola 68300; asserts a breakpoint acknowledge bus cycle with an immediate breakpoint vector (0 to 7) on address lines A2-A4 (not to be confused with address registers), if external hardware terminates the cycle, the data (one instruction word) on the bus is inserted into the instruction pipe, otherwise generates an illegal instruction exception; does not modify flags
CHK Check Register Against Bounds; Motorola 680x0, Motorola 68300; compares a word (16-bits) or longword (32-bits) value in a data register to a lower bound of zero and a twos complement upper bound specified in a data register or memory, a value of less than zero or greater than the upper bound results in a CHK instruction exception, vector number 6; sets or clears flags
CHK2 Check Register Against Two Bounds; Motorola 680x0, Motorola 68300; compares a byte (8-bits), word (16-bits), or longword (32-bits) value in a data or address register to a bounds pair specified in memory, a value of less than the lower bound or greater than the upper bound results in a CHK instruction exception, vector number 6; sets or clears flags
ILLEGAL Take Illegal Instruction Trap; Motorola 680x0, Motorola 68300; generates an illegal instruction exception, vector 4; does not modify flags
TRAPV Trap; Motorola 680x0, Motorola 68300; if the overflow condition is set, generates a TRAPV exception, vector 7; does not modify flags
INT Interrupt; Intel 80x86; pushes flags register and return address on stack and then generates a software call to the interrupt handler designated by the immediate operand (0 to 255) as in index into the Interrupt Descriptor Table (IDT), in Protected Mode the IDT is an array of eight-byte descriptors, in Real Address Mode the IDT is an array of doubleword (32 bit) pointers, the first 32 entries are reserved to Intel (matching hardware interrupts and exceptions), the base address of the IDT is the contents of the IDTR
INTO Interrupt if Overflow; Intel 80x86; if the Overflow flag is set, pushes flags register and return address on stack and then generates a software call to the fourth (4) interrupt handler in the Interrupt Descriptor Table (IDT), in Protected Mode the IDT is an array of eight-byte descriptors, in Real Address Mode the IDT is an array of doubleword (32 bit) pointers, the first 32 entries are reserved to Intel (matching hardware interrupts and exceptions), the base address of the IDT is the contents of the IDTR
IRET Return From Interrupt; Intel 80x86; transfers the value at the top of the system stack into the flags register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer, and changes program flow to the return address; optional immediate operand added to the new top-of-stack pointer, effectively removing any arguments that the calling program pushed on the stack before the execution of the corresponding CALL instruction; possible change to lesser privilege
RTE Return from Exception; Motorola 680x0, Motorola 68300; transfers the value at the top of the system stack into the status register, increments the system stack pointer, fetches the return address from the top of the system stack, increments the system stack pointer by a displacement value designated by format mode (effectively deallocating temporary storage space from the stack, the amount of space varying by type of exception that occurred), and changes program flow to the return address; privileged instruction (supervisor state)
A web site on dozens of operating systems simply cant be maintained by one person. This is a cooperative effort. If you spot an error in fact, grammar, syntax, or spelling, or a broken link, or have additional information, commentary, or constructive criticism, please e-mail Milo. If you have any extra copies of docs, manuals, or other materials that can assist in accuracy and completeness, please send them to Milo, PO Box 1361, Tustin, CA, USA, 92781.