www.flickr.com

Assembly Language8086 Tutorial 4

Monday, April 30, 2012 Posted by Glenn Von Posadas 0 comments

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

Sharing is so Easy:
StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook

Assembly Language8086 Tutorial 3

Posted by Glenn Von Posadas 0 comments

Welcome to my third Assembly Language Programming tutorial for 8086 microprocessors.
In this third tutorial, we will be talking about the registers. By the way, in the next tutorial, we will go on to the 8086 instructions and in the 5th tutorial, finally, I will show you how to print "Hello World" :)

Anyway, there are 14 registers in assembly language 8086. And the most used registers are called: General Purpose Registers.

They are the:


AX- The accumulator(temporary) register
BX- the base address register
CX- the count register
DX- the data register
SI- Source Index register
DI- Destination Index register
BP- Base Pointer
SP- Stack pointer


And such first 4 General purpose registers can be break down into 8 bit registers.
FOR AX: we can have the ah and al
BX: bh and bl
CX: ch and cl
DX: dh and dl


And that's all for the tutorial #3. Yea, there are lots of topics about this register thing, but I won't cover them all. :)
-glenn

Sharing is so Easy:
StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook