Data Transfer Instructions
Data Transfer Instructions
Instruction Set
that the machine understand and indicates what the computer will do. In
needed by the instruction in carrying out its task. An operand may contain a datum, address of the datum, or other information pertaining to the data to be acted on by the instruction.
Example
MOV AX , BX
OP Code
Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Program Transfer Instructions Processor Control Instructions
Where: MOV is the Mnemonic for MOVE AX & BX is the Operand AX is the Destination operand BX is the Source operand
MOV
Mnemonics for MOVE Move the content to/from
move data among registers, memory and the outside world. Also some instructions directly manipulate the stacks while other maybe used to alter the flags.
8/17/2011
PUSH
Mnemonic for Push word to stack This instruction is used to save the
Stack
It is a collection of memory pointed
content of the register so that it can be used for other purpose. The saved data maybe copied into another register or written into memory called STACK
to by the Stack Pointer Register and Stack Segment Register. When we used to write data into the Stack we use this command PUSH Syntax: PUSH Source
POP
Mnemonic for POP word to stack This is the reverse of the PUSH Syntax:
POP Destination
8/17/2011
stack memory and place it into a 16bit register or two memory locations then it increments SP by 2.
IN
Mnemonic for INPUT byte/word
IN Accumulator , Port #
device with port address specified by the instruction to accumulator (AL, AX or EAX).
OUT
Mnemonic for OUTPUT
byte/word to I/O Port. This is the complement of the IN instruction. Syntax: OUT Port #, Accumulator
AX or EAX) to an external output device with port address specified by the instruction.
LEA
Mnemonics for Load Effective
Address
This instruction is used to load the
offset of the source memory operand into one of the processors registers Syntax: LEA Destination , Source
8/17/2011
PUSHF
Mnemonics for Push Flags onto
Stack
This instructions copy the
content of the Flag register into the Stack register. Syntax: PUSHF
POPF
Mnemonics for Pop Flags onto
XCHG
Mnemonics for Exchange data. This instruction is used to swap the
processor register (excluding segment register). The other operand maybe a register or memory location
8/17/2011
XLAT
Mnemonics for Translate Table. This instruction is used translate
code to another code. XLAT replaces a byte in the AL register with a byte pointed to by BX in a lookup table in memory. Before the XLAT instruction can be executed, the lookup table containing values for the new code must be put in memory, andt he offset of the starting address of the lookup table must be loaded in BX. The code byte to be translated is put in AL.
LDS / LES
Mnemonics for Load pointer to DS / The 2nd 2 byte are copied into the
ES This instruction is used to load the two-16 bit register from a 4-byte block of memory The 1st 2 byte are copied into the register specified in the destination operand of the instruction
with words from four memory pointed by [mem]. Copies a word from two memory locations into 16-bit register specified in the instruction. It then copies a word from the next two memory locations into the DS or ES.
LAHF
Mnemonic for Load AH from Flag This command enable to load the
content of the flag register to the higher byte of the Accumulator Syntax: LAHF
8/17/2011
SAHF
This is one way to determine the
new set of flags into the flag register by copying the content of AH register into the LSByte of the flag Syntax: SAHF
End