SlideShare a Scribd company logo
1 of 5
Download to read offline
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

What's hot (20)

Mate tarea - 2º
Mate   tarea - 2ºMate   tarea - 2º
Mate tarea - 2º
 
C++ training day01
C++ training day01C++ training day01
C++ training day01
 
C++ day2
C++ day2C++ day2
C++ day2
 
Ece512 h1 20139_621386735458ece512_test2_solutions
Ece512 h1 20139_621386735458ece512_test2_solutionsEce512 h1 20139_621386735458ece512_test2_solutions
Ece512 h1 20139_621386735458ece512_test2_solutions
 
Notes 10-5
Notes 10-5Notes 10-5
Notes 10-5
 
303
303303
303
 
Tpr star tree
Tpr star treeTpr star tree
Tpr star tree
 
Surface3d in R and rgl package.
Surface3d in R and rgl package.Surface3d in R and rgl package.
Surface3d in R and rgl package.
 
bask, bfsk, bpsk
bask, bfsk, bpskbask, bfsk, bpsk
bask, bfsk, bpsk
 
CPM2013-tabei201306
CPM2013-tabei201306CPM2013-tabei201306
CPM2013-tabei201306
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Multi dimensional profiling
Multi dimensional profilingMulti dimensional profiling
Multi dimensional profiling
 
Htdp27.key
Htdp27.keyHtdp27.key
Htdp27.key
 
Multipipes
MultipipesMultipipes
Multipipes
 
ALPSチュートリアル
ALPSチュートリアルALPSチュートリアル
ALPSチュートリアル
 
Sol71
Sol71Sol71
Sol71
 
Day 3 examples
Day 3 examplesDay 3 examples
Day 3 examples
 
Module 6.7
Module 6.7Module 6.7
Module 6.7
 
Tutorials--Graphs of Logarithmic Functions
Tutorials--Graphs of Logarithmic FunctionsTutorials--Graphs of Logarithmic Functions
Tutorials--Graphs of Logarithmic Functions
 
Presentation 2(power point presentation) dis2016
Presentation 2(power point presentation) dis2016Presentation 2(power point presentation) dis2016
Presentation 2(power point presentation) dis2016
 

Similar to Mpmc unit-string manipulation

8086 labmanual
8086 labmanual8086 labmanual
8086 labmanualiravi9
 
Row patternmatching12ctech14
Row patternmatching12ctech14Row patternmatching12ctech14
Row patternmatching12ctech14stewashton
 
8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptxrularofclash69
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualyeshwant gadave
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Usatyuk Vasiliy
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer KitAmit Kumer Podder
 
java memory management & gc
java memory management & gcjava memory management & gc
java memory management & gcexsuns
 
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14stewashton
 
Debug(1).ppt
Debug(1).pptDebug(1).ppt
Debug(1).pptHebaEng
 

Similar to Mpmc unit-string manipulation (20)

8086 labmanual
8086 labmanual8086 labmanual
8086 labmanual
 
8086 microprocessor lab manual
8086 microprocessor lab manual8086 microprocessor lab manual
8086 microprocessor lab manual
 
Lec06
Lec06Lec06
Lec06
 
8086 labmanual
8086 labmanual8086 labmanual
8086 labmanual
 
8086 labmanual
8086 labmanual8086 labmanual
8086 labmanual
 
Row patternmatching12ctech14
Row patternmatching12ctech14Row patternmatching12ctech14
Row patternmatching12ctech14
 
microprocessors
microprocessorsmicroprocessors
microprocessors
 
Practical notes
Practical notesPractical notes
Practical notes
 
8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx8086 programming guide programs samples and string permutations.pptx
8086 programming guide programs samples and string permutations.pptx
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
 
8086 ins1 data copy
8086 ins1 data copy8086 ins1 data copy
8086 ins1 data copy
 
Chap3 8086 data transfer
Chap3 8086 data transferChap3 8086 data transfer
Chap3 8086 data transfer
 
Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...Cycle’s topological optimizations and the iterative decoding problem on gener...
Cycle’s topological optimizations and the iterative decoding problem on gener...
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
 
java memory management & gc
java memory management & gcjava memory management & gc
java memory management & gc
 
Saga.lng
Saga.lngSaga.lng
Saga.lng
 
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
Row Pattern Matching 12c MATCH_RECOGNIZE OOW14
 
Secure Hash Algorithm
Secure Hash AlgorithmSecure Hash Algorithm
Secure Hash Algorithm
 
Debug(1).ppt
Debug(1).pptDebug(1).ppt
Debug(1).ppt
 
Dsp manual print
Dsp manual printDsp manual print
Dsp manual print
 

More from xyxz

Optimal reception-of-digital-signals
Optimal reception-of-digital-signalsOptimal reception-of-digital-signals
Optimal reception-of-digital-signalsxyxz
 
Optimal reception-of-digital-signals-2
Optimal reception-of-digital-signals-2Optimal reception-of-digital-signals-2
Optimal reception-of-digital-signals-2xyxz
 
Optimal reception-of-digital-signals
Optimal reception-of-digital-signalsOptimal reception-of-digital-signals
Optimal reception-of-digital-signalsxyxz
 
Complex propagation
Complex propagationComplex propagation
Complex propagationxyxz
 
Digital class
Digital classDigital class
Digital classxyxz
 
New ways of teaching entrepreneurship
New ways of teaching entrepreneurshipNew ways of teaching entrepreneurship
New ways of teaching entrepreneurshipxyxz
 
Bits and bandwidth
Bits and bandwidthBits and bandwidth
Bits and bandwidthxyxz
 
Io t system management with
Io t system management withIo t system management with
Io t system management withxyxz
 
Lp iot-iv-ece- 2019-20
Lp iot-iv-ece- 2019-20Lp iot-iv-ece- 2019-20
Lp iot-iv-ece- 2019-20xyxz
 
Jntuh b.tech 3 year ece r16 syllabus
Jntuh b.tech 3 year ece r16 syllabusJntuh b.tech 3 year ece r16 syllabus
Jntuh b.tech 3 year ece r16 syllabusxyxz
 
Devicemgmt
DevicemgmtDevicemgmt
Devicemgmtxyxz
 
29fe586301a42c2d2e7279d658da178ae1e6
29fe586301a42c2d2e7279d658da178ae1e629fe586301a42c2d2e7279d658da178ae1e6
29fe586301a42c2d2e7279d658da178ae1e6xyxz
 
Lecture notes front page sample (1) copy
Lecture notes front page sample (1)   copyLecture notes front page sample (1)   copy
Lecture notes front page sample (1) copyxyxz
 
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2xyxz
 
Ilovepdf merged
Ilovepdf mergedIlovepdf merged
Ilovepdf mergedxyxz
 
Dc lab manual
Dc lab manualDc lab manual
Dc lab manualxyxz
 
Adc lab
Adc labAdc lab
Adc labxyxz
 
Dcs lesson plan 18 19
Dcs lesson plan 18 19Dcs lesson plan 18 19
Dcs lesson plan 18 19xyxz
 
04 sequential circuits
04 sequential circuits04 sequential circuits
04 sequential circuitsxyxz
 
507 block 1_lesson_1
507 block 1_lesson_1507 block 1_lesson_1
507 block 1_lesson_1xyxz
 

More from xyxz (20)

Optimal reception-of-digital-signals
Optimal reception-of-digital-signalsOptimal reception-of-digital-signals
Optimal reception-of-digital-signals
 
Optimal reception-of-digital-signals-2
Optimal reception-of-digital-signals-2Optimal reception-of-digital-signals-2
Optimal reception-of-digital-signals-2
 
Optimal reception-of-digital-signals
Optimal reception-of-digital-signalsOptimal reception-of-digital-signals
Optimal reception-of-digital-signals
 
Complex propagation
Complex propagationComplex propagation
Complex propagation
 
Digital class
Digital classDigital class
Digital class
 
New ways of teaching entrepreneurship
New ways of teaching entrepreneurshipNew ways of teaching entrepreneurship
New ways of teaching entrepreneurship
 
Bits and bandwidth
Bits and bandwidthBits and bandwidth
Bits and bandwidth
 
Io t system management with
Io t system management withIo t system management with
Io t system management with
 
Lp iot-iv-ece- 2019-20
Lp iot-iv-ece- 2019-20Lp iot-iv-ece- 2019-20
Lp iot-iv-ece- 2019-20
 
Jntuh b.tech 3 year ece r16 syllabus
Jntuh b.tech 3 year ece r16 syllabusJntuh b.tech 3 year ece r16 syllabus
Jntuh b.tech 3 year ece r16 syllabus
 
Devicemgmt
DevicemgmtDevicemgmt
Devicemgmt
 
29fe586301a42c2d2e7279d658da178ae1e6
29fe586301a42c2d2e7279d658da178ae1e629fe586301a42c2d2e7279d658da178ae1e6
29fe586301a42c2d2e7279d658da178ae1e6
 
Lecture notes front page sample (1) copy
Lecture notes front page sample (1)   copyLecture notes front page sample (1)   copy
Lecture notes front page sample (1) copy
 
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
Jntua ece 3rd & 4th year (r15) syllabus (1) split-merge-1-4-1-2
 
Ilovepdf merged
Ilovepdf mergedIlovepdf merged
Ilovepdf merged
 
Dc lab manual
Dc lab manualDc lab manual
Dc lab manual
 
Adc lab
Adc labAdc lab
Adc lab
 
Dcs lesson plan 18 19
Dcs lesson plan 18 19Dcs lesson plan 18 19
Dcs lesson plan 18 19
 
04 sequential circuits
04 sequential circuits04 sequential circuits
04 sequential circuits
 
507 block 1_lesson_1
507 block 1_lesson_1507 block 1_lesson_1
507 block 1_lesson_1
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 

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