Professional Documents
Culture Documents
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
CHAPTER-3
Immediate
Direct
Indirect
Register
Register Indirect
Displacement (Indexed)
Immediate Addressing
Operand is part of instruction
Operand = address field
e.g. ADD 5
Add 5 to contents of accumulator
5 is operand
No memory reference to fetch data
Fast
Limited range
Direct Addressing
Address field contains address of operand
Effective address (EA) = address field (A)
e.g. ADD A
Add contents of cell A to accumulator
Look in memory at address A for operand
Single memory reference to access data
No additional calculations to work out effective address
Limited address space
Indirect Addressing (1)
Memory cell pointed to by address field contains the address of (pointer to)
the operand
Microprocessor
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
EA = (A)
Look in A, find address (A) and look there for operand
e.g. ADD (A)
Add contents of cell pointed to by contents of A to accumulator
Register Addressing
Operand is held in register named in address filed
EA = R
Limited number of registers
Very small address field needed
Shorter instructions
Faster instruction fetch
Relative Addressing
Assembly Language
Alphanumeric equivalent of machine language
Assembler
Microprocessor
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
Statement syntax
Name field
operation field
operand field
comment field
Name field
Used for instruction labels, procedure names, and variable names.
Special characters?. @ _ $ %
Microprocessor
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
Case insensitive
COUNTER1
@character
SUM_OF_DIGITS
$1000
Done?
2abc
A45.28
You & Me
Operation field
instruction
Assembler directive
Microprocessor
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
Operand field
Specifies data to be acted on
Comment field
A semicolon marks the beginning of a comment
Examples
MOV CX, 0
Initialize registers
Variable Declaration
Each variable has a type and assigned a memory address.
Data-defining pseudo-ops
DB define byte
DW define word
Each pseudo-op can be used to define one or more data items of given type
Named Constants
EQU pseudo-op used to assign a name to constant.
Instruction Types
Data transfer instructions
Arithmetic instructions
String instructions
Move, compare, and scan strings of information.
MOV
Microprocessor
CHAPTER-3
8086 Microprocessor Programming &
Instruction Sets:
Interrupt instructions
Linking a program
The .OBJ file is a machine language file but cannot be run
Some addresses not filled since its not known where a program
LINK PROG1
System BIOS
A set of programs always present in system