You are on page 1of 74

Unit III

8086 Instruction set and Assembler


Directives
CAM – Course Objectives and Course Outcomes
CAM – Course Syllabus
CAM – Course Syllabus
Single Bit Indicators in Opcode
Assignment of Codes with different registers
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Addressing Modes of 8086
Forming the effective address
Instruction Set of 8086
Data Copy/Transfer Instruction
Arithmetic Instruction
Add with Carry
Increment and Decrement
ORG 100h
.MODEL SMALL
.DATA NUM_1
DW 0F213H
NUM_2 DW 41A8H
.CODE
MOV AX, NUM_1 ;Load numerator in AX
DIV NUM_2 ;Divide AX by NUM_2 RET
Logical Instructions
assume ds:data,es:extra,cs:code
code segment
String Transfer mov ax,data
mov ds,ax
mov ax,extra
mov es,ax
mov si,offset str1
mov di,offset str2
mov cl,0bh
cld
rep movsb
hlt
code ends
data segment
str1 db ‘geethanjali’
data ends
extra segment
str2 db 0bh dup(0)
extra ends
end
PROGRAM:
assume es:extra,cs:code
Length of the String code segment
mov ax,extra
mov es,ax
mov di,offset str
mov cl,00h
mov al,’$’
cld
abc: scasb
je xyz
inc cl
Jmp abc
xyz:hlt
code ends
extra segment
str db ‘geethanjali$’
extra ends
end
assume ds:data, es:extra, cs:code
code segment
mov ax,data
mov ds,ax
mov ax,extra
String Comparison
mov es,ax
mov si,offset str1
mov di,offset str2
mov cl,0bh
cld
abc: cmpsb
Jne xyz
loop abc
mov bx,1111h
jmp abc1
xyz: mov bx,0000h
abc1: hlt
code ends
data segment
str1 db ‘geethanjali’
data ends
extra segment
str2 db ‘geethanjali’
extra ends
end
Control Transfer or Branching
Assembler Directives

You might also like