AH AL
BH BL
CH CL
DH DL
SP
BP
DI
SI
CS
DS
SS
ES
IP
Internal
communication
register
Σ
EU
Control
System
Temporary Register
Flags
ALU
BUS
Control
Logic
ALU Data BUS (16 bit)
Instruction Queue
Queue
BUS
(8bit)
Data BUS
(16 bit)
8086
BUSES
Add BUS (20 bit)
General Registers
4
3
2
1 6
5
1. BIU O/Ps IP
2. IP=IP+1
3. Instruction Queue
4. EU draws Instr. &
Execute it.
5. BIU Fetches another
Inst. While in the
same time EU
executing the 1st
Inst.
PIPE LINEING
FIFO
FETCH
overlaps with
Execute
PA = SBR or (SR) : EA
= : + +
The Operand resides
in an internal Register.
Examples:
AND AL,DH
AND BX,CX
It is a method for specifying an Operand
The Operand is a part
of the Instruction.
Examples:
AND AL,80h
AND 0800h,BX
Direct Add.
Register
indirect Add.
Based Add.
Indexed Add.
Based
Indexed Add.
CS
DS
ES
SS
BX
BP
SI
DI
8-BIT or
16-BIT Displacement
;This program is used to test PPI1 Mode2 and . . . . . . . .
;Date: 28/7/2008
code segment
assume cs:code,ds:code
org 0
start:
mov ax,cs ;Comments
mov ds,ax ;ds=cs
hlt
DSeg DB 00,10h,0F2h,
code ends
end start
Assembly
Program
Structure
LABLES
COMMENTS
DIRECTIVES
INSTRUCTIONS
The DB & DW directives:
Examples:
Variable Name DB Aah ;VARIABLE NAME(BYTE) = AAh
DATA1 DW Aah ;DATA1(WORD) = AAh
X DB 50DUP(?) ;50 BYTES OF MEM. ARE RESERVED
;FOR X WITH NO INITIAL VALUE
STUDENTS DW 38DUP(?) ;38 WORDS OF MEM. ARE RESERVED FOR
; STUDENTS WITH NO INITIAL VALUE
TABLE DB 11h,0Abh,29h,50h,33h,0FDh,0B0h
;THESE VALUES ARE ASSIGNED FOR
;TABLE VARIABLE
NAMES DB 100DUP(‘U’)
;FILL 100-BYTES OF MEMORY STARTING
;AT EA=NAMES WITH ASCII (U)
INPUTS & OUTPUTS FOR MASM & LINK
MASM LINK
prog.obj
prog.exe
prog.asm
prog.lst
Examples: Convert the following Instruction mnemonics
to there machine codes.
(A) MOV BL,AL
1- OPCODE = 100010 2- W=0 (8-BIT)
3- Let REG be the source i.e: D=0 4- then REG = 000 for AL
5- MOD =11 6- Then R/M = 011
100010 0 0 11 000 011 = 88C3h