Laboratory Manual Course Title: Assembly Language Programming Course Code: CSE 236
Laboratory Manual Course Title: Assembly Language Programming Course Code: CSE 236
Laboratory Manual
8 Email haisam@cse.uiu.ac.bd
10 Text Book Assembly language Programming and Programming Organization of the IBM
- PC Ytha Yu and Charles Marut
11 Course Objectives
(COs)
COs Description
- Assignments 35
- Class Performance 15
PO PO PO PO PO PO PO PO PO PO PO PO
1 2 3 4 5 6 7 8 9 10 11 12
CO1 x
CO2 x x
CO3 x x
CO4 x x x
Lab Outline:
Lab Manual
Topic Name: Introduction: 8086 microprocessor, memory, CPU, I/O, 8086 instructions and
coding in EMU8086, registers, pointers and Flags
3 Practice problem
● Take input 2 binary number and do the ADD, SUB, AND, OR, XOR operations.
2 Practice problem :
● Convert an uppercase letter to lowercase and vice versa
● Find the largest among three numbers (in AX, BX and CX).
● Assume that AX=5, BX=7, CX=4. Now find the value of the expression, 2AX - 3CX + 4(BX - AX)
and show it in AX.
CSE 236 Lab - 3
4 Practice problems
● Read until a blank character is read
● Write a program to count the number of vowels read until a ‘q’ or ‘Q’ is pressed
3 Practice Problem
• Find the Least Common Multiple (LCM) of three given numbers. LCM for 10, 20, 30 is 60
• Find whether a given number is prime or not. A prime number can only be divided by 1 and
number itself. 17 is a prime number, 24 is not.
• Find the average of n numbers. The average for 10, 20, 30 is 20
1 Procedure for multiplication without using MUL instruction (using left shift and right shift)
2 Using stack to print the input characters in reverse order
3 Practice Problem
● Write a program to take five lowercase characters and display them in reverse order after
converting to uppercase and vice versa
● Write a program to take five lowercase characters and display them in same order after
converting to uppercase
● Implement the above two problems in a single program calling separate procedures
● Write a program to determine if a number in AX is even or odd, positive or negative, prime or not
prime using three different procedures
3 Practice Problem
● Write a program to determine if a number is prime or not.
● Write a program to determine the factorial of a number.
● Write an assembly program that checks whether an year is a leap year or not.
● Input a decimal number then show it in its binary form.
4 Practice Problem
● Write a procedure REVERSE that will reverse an array of N words. This means that the Nth word
becomes the first, the (N-l)th word becomes the second, and so on, and the first word becomes the
Nth word. The procedure ls entered with SI pointing to the array, and BX has the number of words
N.
● Write a procedure REVERSE that will print the odd indexed elements of an array in reverse order.
1 Copy one string into another in the same and the reverse order
4 Practice Problem
● An assembly program that takes a sentence as input and finds out the number of words in that
sentence. The full stop('.') denotes the end of input. There may be more than one space between
two adjacent words. Space is the only whitespace character that is used in our program. The
output must be a 2-digit number.
Input-1:
--------
Hello World.
Output-1:
---------
02
Input-2:
--------
Dhaka is the capital city of Bangladesh.
Output-3:
---------
07
.
● A program to counting the number of vowels and consonants in a string.
● Write a procedure SUM will take 2 array of same size as parameter. Sum each index value of both array
and store the value in another array at the same index. E.g. A[0]+B[0]=C[0]. Use both the addressing
modes-
a. Register indirect mode.
b. Based and Indexed addressing mode.
1 Suppose STR1 and STR2 are strings of length 10. We put O in AX if the strings are identical, put 1 in
AX if STR1 comes first alphabetically, or put 2 in AX if STR2 comes first alphabetically (assume DS
and ES are initialized).
2 Lecture on interrupt and recursion and review.