SlideShare a Scribd company logo
8086 STRING MANIPULATIONS
PROGRAMS ON STRING MANIPULATIONS
a) Block Transfer:
data segment
num db 32h,30h,29h,25h
num2 db 04 dup(0)
data ends
code segment
assume ds:data,cs:code
start:mov ax,data
mov ds,ax
mov es,ax
mov si,offset num
mov di,offset num2
mov cl,04h
rep movsb
hlt
code ends
end start
b) Block Transfer:
data segment
num db 32h,30h,29h,25h
num2 db 04 dup(0)
data ends
code segment
assume ds:data,cs:code
start:mov ax,data
mov ds,ax
mov es,ax
mov si,offset num
mov di,offset num2
mov bx,0004h step:
dec bx
lodsb
mov [bx][di],al
jnz step
hlt
code ends
end start
8086 STRING MANIPULATIONS
c) Insertion of a string:
data segment
num1 db 32h,30h,29h,25h
num2 db 26h,31h
place dw 0001h
length1 db 04h
length2 db 02h
result db 07 dup(0)
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov es,ax
mov si,offset num1
mov bx,offset num2
mov di,offset result
mov cl,length1
mov ch,length2
back:
cmp si,place
je li
here:
lodsb
stosb
dec cl
jnz back
hlt
li:
mov al,[bx]
mov [di],al
inc di
inc bx
dec ch
jnz li
jmp here
code ends
end start
d) Deletion of a string:
data segment
giv db 32h,30h,29h,25h
8086 STRING MANIPULATIONS
place dw 0000h
lgiv dw 0004h
ldel dw 0002h
result db 06 dup(0)
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov es,ax
mov si,offset giv
mov di,offset result
mov cx,0000h back:
cmp si,place
je li
lodsb
stosb
inc cx
here:
cmp cx,lgiv
jb back
hlt
li:
add cx,ldel
add si,ldel
jmp here
code ends
end start
8086 CONVERSIONS
PROGRAMS ON CONVERSIONS
a) BCD to Hexa conversion
data segment
num1 db 32h
result dw 01 dup(0)
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov al,num1
mov bl,num1
mov cl,04h
and al,0f0h
and bl,0fh
shr al,cl
mov ch,0ah
mul ch
add al,bl
mov result,al
hlt
code ends
end start
b) Hexa to Ascii coded BCD
data segment
num1 db 22h
result dw 01 dup(0)
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov al,num1
mov ah,00h
mov bl,0ah
div bl
xchg al,ah
add ax,3030h
mov result,ax
hlt
8086 CONVERSIONS
code ends
end start
c) Packed to unpacked BCD
data segment
num1 db 32h
result dw 01 dup(0)
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov al,num1
mov bl,num1
and al,0fh
and bl,0f0h
mov cl,04h
shr bl,cl
mov ah,bl
add ax,3030h
mov result,ax
hlt
code ends
end start

More Related Content

PPT
4.5 tan and cot.ppt worked
PPT
4.5 sec and csc worked 3rd
PPT
Graphing day 1 worked
PPTX
K10692 control theory
PDF
Lesson 5 Nov 3
PDF
Prim1_secx
TXT
Demodulate bpsk up
PPTX
Longitud de curvas
4.5 tan and cot.ppt worked
4.5 sec and csc worked 3rd
Graphing day 1 worked
K10692 control theory
Lesson 5 Nov 3
Prim1_secx
Demodulate bpsk up
Longitud de curvas

What's hot (20)

PPTX
Mate tarea - 2º
PPTX
C++ training day01
PPTX
PDF
Ece512 h1 20139_621386735458ece512_test2_solutions
PDF
Notes 10-5
PPT
Tpr star tree
DOCX
Surface3d in R and rgl package.
DOC
bask, bfsk, bpsk
PPTX
CPM2013-tabei201306
PPTX
Asymptotic Notation
PDF
Multi dimensional profiling
PDF
Htdp27.key
PDF
PDF
PDF
Day 3 examples
PPTX
Module 6.7
PPT
Tutorials--Graphs of Logarithmic Functions
PPTX
Presentation 2(power point presentation) dis2016
Mate tarea - 2º
C++ training day01
Ece512 h1 20139_621386735458ece512_test2_solutions
Notes 10-5
Tpr star tree
Surface3d in R and rgl package.
bask, bfsk, bpsk
CPM2013-tabei201306
Asymptotic Notation
Multi dimensional profiling
Htdp27.key
Day 3 examples
Module 6.7
Tutorials--Graphs of Logarithmic Functions
Presentation 2(power point presentation) dis2016
Ad

Similar to Mpmc unit-string manipulation (20)

PDF
8086 microprocessor lab manual
PDF
8086 labmanual
PPTX
PPTX
8086p fundamental programming execution in masm
PDF
8086 labmanual
PDF
8086 labmanual
PPTX
Row patternmatching12ctech14
PPT
microprocessors
PPTX
Practical notes
PPTX
8086 programming guide programs samples and string permutations.pptx
PDF
Microprocessor 8086-lab-mannual
PPTX
Chap3 8086 data transfer
PPTX
8086 ins1 data copy
PPTX
Cycle’s topological optimizations and the iterative decoding problem on gener...
PPTX
8086 Micro-processor and MDA 8086 Trainer Kit
PPTX
java memory management & gc
TXT
Saga.lng
PPTX
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
PPTX
Secure Hash Algorithm
PPT
Debug(1).ppt
8086 microprocessor lab manual
8086 labmanual
8086p fundamental programming execution in masm
8086 labmanual
8086 labmanual
Row patternmatching12ctech14
microprocessors
Practical notes
8086 programming guide programs samples and string permutations.pptx
Microprocessor 8086-lab-mannual
Chap3 8086 data transfer
8086 ins1 data copy
Cycle’s topological optimizations and the iterative decoding problem on gener...
8086 Micro-processor and MDA 8086 Trainer Kit
java memory management & gc
Saga.lng
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Secure Hash Algorithm
Debug(1).ppt
Ad

More from xyxz (20)

PDF
Optimal reception-of-digital-signals
PDF
Optimal reception-of-digital-signals-2
PDF
Optimal reception-of-digital-signals
PPT
Complex propagation
PPT
Digital class
PPTX
New ways of teaching entrepreneurship
PDF
Bits and bandwidth
PPTX
Io t system management with
PDF
Lp iot-iv-ece- 2019-20
PDF
Jntuh b.tech 3 year ece r16 syllabus
PPTX
Devicemgmt
PDF
29fe586301a42c2d2e7279d658da178ae1e6
PDF
Lecture notes front page sample (1) copy
PDF
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
PDF
Ilovepdf merged
PDF
Dc lab manual
PDF
Adc lab
DOC
Dcs lesson plan 18 19
PDF
04 sequential circuits
PDF
507 block 1_lesson_1
Optimal reception-of-digital-signals
Optimal reception-of-digital-signals-2
Optimal reception-of-digital-signals
Complex propagation
Digital class
New ways of teaching entrepreneurship
Bits and bandwidth
Io t system management with
Lp iot-iv-ece- 2019-20
Jntuh b.tech 3 year ece r16 syllabus
Devicemgmt
29fe586301a42c2d2e7279d658da178ae1e6
Lecture notes front page sample (1) copy
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
Ilovepdf merged
Dc lab manual
Adc lab
Dcs lesson plan 18 19
04 sequential circuits
507 block 1_lesson_1

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Microbial diseases, their pathogenesis and prophylaxis
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
VCE English Exam - Section C Student Revision Booklet
O7-L3 Supply Chain Operations - ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pre independence Education in Inndia.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
TR - Agricultural Crops Production NC III.pdf
PPH.pptx obstetrics and gynecology in nursing
Anesthesia in Laparoscopic Surgery in India
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
2.FourierTransform-ShortQuestionswithAnswers.pdf
01-Introduction-to-Information-Management.pdf
Basic Mud Logging Guide for educational purpose
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Microbial diseases, their pathogenesis and prophylaxis

Mpmc unit-string manipulation

  • 1. 8086 STRING MANIPULATIONS PROGRAMS ON STRING MANIPULATIONS a) Block Transfer: data segment num db 32h,30h,29h,25h num2 db 04 dup(0) data ends code segment assume ds:data,cs:code start:mov ax,data mov ds,ax mov es,ax mov si,offset num mov di,offset num2 mov cl,04h rep movsb hlt code ends end start b) Block Transfer: data segment num db 32h,30h,29h,25h num2 db 04 dup(0) data ends code segment assume ds:data,cs:code start:mov ax,data mov ds,ax mov es,ax mov si,offset num mov di,offset num2 mov bx,0004h step: dec bx lodsb mov [bx][di],al jnz step hlt code ends end start
  • 2. 8086 STRING MANIPULATIONS c) Insertion of a string: data segment num1 db 32h,30h,29h,25h num2 db 26h,31h place dw 0001h length1 db 04h length2 db 02h result db 07 dup(0) data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax mov es,ax mov si,offset num1 mov bx,offset num2 mov di,offset result mov cl,length1 mov ch,length2 back: cmp si,place je li here: lodsb stosb dec cl jnz back hlt li: mov al,[bx] mov [di],al inc di inc bx dec ch jnz li jmp here code ends end start d) Deletion of a string: data segment giv db 32h,30h,29h,25h
  • 3. 8086 STRING MANIPULATIONS place dw 0000h lgiv dw 0004h ldel dw 0002h result db 06 dup(0) data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax mov es,ax mov si,offset giv mov di,offset result mov cx,0000h back: cmp si,place je li lodsb stosb inc cx here: cmp cx,lgiv jb back hlt li: add cx,ldel add si,ldel jmp here code ends end start
  • 4. 8086 CONVERSIONS PROGRAMS ON CONVERSIONS a) BCD to Hexa conversion data segment num1 db 32h result dw 01 dup(0) data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax mov al,num1 mov bl,num1 mov cl,04h and al,0f0h and bl,0fh shr al,cl mov ch,0ah mul ch add al,bl mov result,al hlt code ends end start b) Hexa to Ascii coded BCD data segment num1 db 22h result dw 01 dup(0) data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax mov al,num1 mov ah,00h mov bl,0ah div bl xchg al,ah add ax,3030h mov result,ax hlt
  • 5. 8086 CONVERSIONS code ends end start c) Packed to unpacked BCD data segment num1 db 32h result dw 01 dup(0) data ends code segment assume ds:data,cs:code start: mov ax,data mov ds,ax mov al,num1 mov bl,num1 and al,0fh and bl,0f0h mov cl,04h shr bl,cl mov ah,bl add ax,3030h mov result,ax hlt code ends end start