Description
Semester: V
Experiment No 3: String Manipulations
3 a) Moving a string of bytes
Inputs: A source string, size of the source string (No. of bytes in the string), starting location of the source string and destination location
Output: A string of given size should be copied from source location to destination location.
Hint:
Instructions to be used:
REP MOVSB
3 b) Comparing 2 strings of bytes
Inputs: 2 strings of same size: string1 and string 2, size of the strings, starting locations of string1 and string2.
Output: A byte in memory location which gives zero if the strings are equal else the index of first mismatch.
Hint:
Instructions to be used:
REPE CMPSB
3 c) Searching a byte in a string
Inputs: A string, size of the string, starting location of the string and a byte to be searched. Output: A byte in memory location which gives zero if the given byte is not found in the string else its index of first occurrence.
Hint:
Instructions to be used:
REPNE SCASB
3 d) Moving a string without using string instructions
Inputs: A source string, size of the source string, starting location of the source string and destination location
Output: A string of given size should be copied from source location to destination location without using string instructions.




Reviews
There are no reviews yet.