Professional Documents
Culture Documents
Objective(s):
Upon completion of this lab session, learners will be able to:
The objective of this lab is to implement different programs related to string instructions.
Lab Tasks
Task 1: Write a program to copy the contents of a string to other string in reverse order. Make a general
program which reverse string of any length.
Task 2: Write a program to reading and storing a character string. The algorithm is as follows:
chars_read = 0
read a char
WHILE char is not a carriage return DO
IF char is backspace THEN
chars_read = chars_read – 1
remove previous char from string
ELSE
store char in string
chars_read = chars_read + 1
END_IF
read a char
END_WHILE
Task 3:
Suppose:
1
Computer Organization and Assembly Language-Lab Instructor: Mughees Ahmad
Give the source, destination, and the value moved for each of the following instructions. Also give the
new contents of SI and DI. Fill out the following table.
No Instructions Values (Contents in hex, of the source or destination which Values of SI or DI which modified
. modified)
1. MOVSB
2. MOVSW
3. STOSB
4. STOSW
5. LODSB
6. LODSW
Max
Obtained
Task Mark Comments(if any)
Marks
s
1. 04
2. 04
3. 02
2
Computer Organization and Assembly Language-Lab Instructor: Mughees Ahmad
Total 10 Signature
Note : Attempt all tasks and get them checked by your Lab Instruct
3
Computer Organization and Assembly Language-Lab Instructor: Mughees
Ahmad