You are on page 1of 4

Computer Organization and Assembly Language-Lab Instructor: Mughees Ahmad

Bahria University, Lahore Campus


Department of Computer Science
Lab Journal 12
(Fall 2023)

Computer Organization and Assembly Language-


Course: Lab Date: _______________
Course Code: CEL 325 Max Marks: 10
Faculty’s Name: Mughees Ahmad

Name: _____________________ Enroll No: ___________________ Class: ______________

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:

SI contains 100h Byte 100h contains 10h

1
Computer Organization and Assembly Language-Lab Instructor: Mughees Ahmad

DI contains 200h Byte 101h contains 15h


AX contains 4142h Byte 200h contains 20h
DF = 0 Byte 201h contains 25h

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

Lab Grading Sheet :

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

You might also like