Assembly Language8086 Tutorial 4
Monday, April 30, 2012
Welcome again to my tutorial on Assembly Language for 8086 microprocessor. This is my 4th tutorial and I will teach you the different 8086 instructions as well as how to use them
So let's start.
First is the "MOV instruction"
Read as "move". Yea, basically this instruction is used to move a value. Take note, it only copies a value not "Cut".
Mov instruction copies the second operand (source) to the first operand (destination)
for example:
mov ah, 02h
So what does that mean huh? The 02 Hexadecimal Value (why hexa? Simply because it has an "H") will be copied, take note: copy, to the high byte of AX register which is the AH register :) Don't be confused.
Take note again: in order for you to memorize it, simply remember this: MOV "TO", "FROM". Yea, just like in C++ and other programming languages. The syntax is TO comma FROM.
Going on... the source operand can be an immediate value, general-purpose register or memory location.
The destination register can be a general-purpose register, or memory location. And both operands must be the same size, which can be a byte or a word.
THESE TYPES OF OPERANDS ARE SUPPORTED:
1. Memory to Register
2. Register to Memory
3. Register to Register
4. Immediate to Register
5. Register to Immediate
MEMORY: [BX]. [BX+SI+7], variable, etc...
IMMEDIATE: 5, -24, 3Fh. 10001101b, etc...
For segnebt regusters, only these types of MOV are supported:
1. Segment Register to Memory
2. Memory to Segment Register
3. Segment Register to Register
4. Regiser to Segment Register
SREG: DS, ES, SS, and only as second operand: CS
REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP
Note that MOV instruction CANNOT be used to set the value of the CS and IP Registers.
annnnnnnnnnnnnnnnnnnd.... That's all! :)
Tutorial #5 will be the start of program making. :)
-Glenn
So let's start.
First is the "MOV instruction"
Read as "move". Yea, basically this instruction is used to move a value. Take note, it only copies a value not "Cut".
Mov instruction copies the second operand (source) to the first operand (destination)
for example:
mov ah, 02h
So what does that mean huh? The 02 Hexadecimal Value (why hexa? Simply because it has an "H") will be copied, take note: copy, to the high byte of AX register which is the AH register :) Don't be confused.
Take note again: in order for you to memorize it, simply remember this: MOV "TO", "FROM". Yea, just like in C++ and other programming languages. The syntax is TO comma FROM.
Going on... the source operand can be an immediate value, general-purpose register or memory location.
The destination register can be a general-purpose register, or memory location. And both operands must be the same size, which can be a byte or a word.
THESE TYPES OF OPERANDS ARE SUPPORTED:
1. Memory to Register
2. Register to Memory
3. Register to Register
4. Immediate to Register
5. Register to Immediate
MEMORY: [BX]. [BX+SI+7], variable, etc...
IMMEDIATE: 5, -24, 3Fh. 10001101b, etc...
For segnebt regusters, only these types of MOV are supported:
1. Segment Register to Memory
2. Memory to Segment Register
3. Segment Register to Register
4. Regiser to Segment Register
SREG: DS, ES, SS, and only as second operand: CS
REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP
Note that MOV instruction CANNOT be used to set the value of the CS and IP Registers.
annnnnnnnnnnnnnnnnnnd.... That's all! :)
Tutorial #5 will be the start of program making. :)
-Glenn
Sharing is so Easy: |
Labels:
Assembly Language,
Programming,
turorial