انواع شیفت و چرخش

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.

    ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

ddddddddddddddddddddddd

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

شکوفه رضایی پور sh.sare@yahoo.com

8085 INSTRUCTION SET

INSTRUCTION SUMMARY

        

 

DATA TRANSFER INSTRUCTIONS

 

MOV

Copy from source to destination

MVI    

Move immediate 8-bit

LDA    

Load accumulator

LDAX 

Load accumulator indirect

LXI  

Load register pair immediate

LHLD  

Load H and L registers direct

STA 

Store accumulator direct

STAX 

Store accumulator indirect

SHLD

Store H and L registers direct

XCHG

Exchange H and L with D and E

SPHL 

Copy H and L registers to the stack pointer

XTHL

Exchange H and L with top of stack

PUSH 

Push register pair onto stack

POP

Pop of stack to register pair

OUT  

Output data from accumulator to a port with 8-bit  address

 

ARITHMETIC INSTRUCTIONS

 

ADD

Add register or memory to accumulator

ADC    

Add register to accumulator with carry

ADI

Add immediate to accumulator

ACI      

Add immediate to accumulator with carry

DAD  

Add register pair to H and L registers

SUB

Subtract register or memory from accumulator

SBB

Subtract source and borrow from accumulator

SUI

Subtract immediate from accumulator

INX

Increment register pair by 1

DCR

Decrement register or memory by 1

DCX    

Decrement register pair by 1

DAA    

Decimal adjust accumulator

 

CONTROL INSTRUCTIONS

 

NOP

No operation

HLT

Halt

DI

Disable interrupts

EI  

Enable interrupts

RIM

Read interrupt mask

SIM

Set interrupt mask

 

 

 

BRANCHING INSTRUCTIONS

 

JMP

Jump unconditionally

JC

Jump on carry

JNC

Jump on no carry

JP

Jump on positive

JM  

Jump on minus

JZ   

Jump on zero

JNZ      

Jump on no zero

JPE

Jump on parity even

JPO

Jump on parity odd

CALL

Call unconditionally

 CC

Call on carry

 CNC

Call on no carry

CP

Call on positive

CM      

Call on minus

CZ

Call on zero

CNZ

Call on no zero

 CPE    

Call on parity even

CPO

Call on parity odd

RET

Return unconditionally

RC

Return on carry

RNC

Return on no carry

RP

Return on positive

RM

Return on minus

RZ

Return on zero

RNZ

Return on no zero

RPE

Return on parity even

RPO

Return on parity odd