Documentos de Académico
Documentos de Profesional
Documentos de Cultura
LAB MANUAL
ISSUED BY MR/ISO
SUBJECT : BCS207 MICROPROCESSORS LAB
(Regulation 2007)
SEMESTER : II
BRANCH : BSc Computer Technology
INDEX
5 BCD Subtraction
6 8 bit Multiplication
7 BCD Multiplication
8 8 bit Division
16
17
18
Ex.No.15
STRING MANIPULATION OPERATIONS
Aim:
(a) To write an assembly language program to move a string of 16-BIT data
from locations in data segment to locations in extra segment.
(b) Program to compare whether two strings of data are equal. If so, store
AAH at location 5000h, if not store DDH
Specifications:
Algorithm:
1.Load the current value in CX register
2.Store the destination address in DI register
3.Store the source address in SI register
4.Repeat movsw this component used to repeat above 3 steps up to count value equal
to zero
5.HLT the program
Program:
Procedure:
1.Key in the code from the address specified
2.Enter the count value
3.Execute the program and check the result
Algorithm:
1.Load the count value in CX register
2.Add registers of string 1 located in DI register
3. Add registers of string 2 located in SI register
4.Compare the content of SI and PI register repeat until above values are equal or
count become zero.
5.If z=1 continue to next step, else go to next step 8
6.Move ‘AA’H value in memory location
7.Jump step 9
8. Move ‘DD’H value in memory location
9.HLT the program
Program:
MOV CX, COUNT
MOV DI, OFFSET OF STRING 1
MOV SI, OFFSET OF STRING2
REPE CMPB
JNZ LOOP
MOV [5000H], AAH
JMP END
LOOP: MOV [5000H], DDH
END: HLT
Procedure:
Result:
Thus program to move a string of 16-BIT data from locations in data segment
to locations in extra segment and program to compare whether two strings of data are
equal is written and executed.