The instructions that transfer data between registers, memory locations or segment registers.
It is again classified into four types. They are,
It is again classified into four types. They are,
1.General purpose byte or word transfer instructions
2.Special address transfer instructions
3.Flag transfer instructions
4.Simple input and output Port transfer instructions
1.General purpose byte or word transfer instructions
MOV: It copies the content of source to the destination.
Eg. : MOV BX, 5978H ; Load the immediate number 5978H to BX.
MOV CL, [453AH] ; Copies the content of memory location which is at a distant of 453AH from the data segment into CL register.
MOV DS, CX ; Copies the word from CX to data segment.
PUSH
• It decrements the stack pointer by 2.
• It stores the 16 bit data from the source to the address in the stack pointer.
Eg. : SP = 80983H
CX = 49A3H
PUSH CX
SP = 80981H
[CX]----> SP
POP
•It stores the 16 bit data from the destination to the stack pointer.
•It increments the stack pointer by 2.
Eg. : SP = 80983H
CX = 49A3H
POP CX
[CX]
SP = 80985H
XCHG: It exchanges the contents of source with the destination.
Eg. : XCHG BX, CX ; Exchange word in CX with word in BX.
XCHG BL, CL ; Exchange byte in CL with byte in BL.
XLAT :
•IT replaces byte in AL register.
•BX is having the offset value of memory location.
•It copies byte from address pointed by [BX + AL ] into AL register.
2. Special address transfer instructions:
LEA:
•Load effective address.
•The mnemonics is LEA register, source.
•Source is having the offset of the memory location and this instruction load this address into 16 bit register.
LDS:
•The mnemonics is LDS register, memory address of first word.
•It copies a word from two memory locations into the register.
•It then copies a word from next two memory locations into the DS register.
Eg. : LDS CX, [391AH]
LES:
• The mnemonics is LES register, memory address of first word.
• It copies a word from two memory locations into the register.
• It then copies a word from next two memory locations into the ES register.
Eg. : LES CX, [391AH]
3. Flag Transfer Instructions:
LAHF : This instruction copies the contents of lower byte of 8086 flag register to AH register.
SAHF : The contents of the AH register are copied into the lower byte of the 8086 flag register.
PUSHF: This instruction decrements the stack pointer by 2 and copies the word in the flag register to the memory locations pointed by the stack pointer.
POPF : This instruction copies a word the two memory locations at the top of the stack to the flag register and increments the stack pointer by 2.
4. Simple Input and Output Port Transfer Instructions:
IN :
•This instruction will copy data from a port to the accumulator.
•If an 8 bit port is read the data will go to AL and if an 16 bit port is read the data will go to AX.
OUT : The OUT instruction copies a byte from AL or a word from AX to the specified port.
No comments:
Post a Comment