The University of Lahore, CS & IT Department
Computer Organization & Assembly Language
                                    Assignment # 2
                                        Instructions
 1. Understanding of the problems is part of the assignments.
 2. You will get Zero marks if found any type of cheating.
 3. 25% deduction of over marks on the one-day late submission after due date
 4. 50% deduction of over marks on the two-day late submission after due date
 5. No submission after two days.
 Submission Method:
     • Assignment must be submitted individually.
     • Make separate files of individual codes and a PDF file of all the codes and their respective
         outputs and submit all the files together in a .zip file.
     • Upload the solved assignment (soft copy) at university portal before the deadline.
 Guidelines:
     • Assignment to be submitted individually.
     • Convert your solution into a clear PDF and upload it on the university portal.
     • Use the file naming convention: sapID_Qn_A3.asm
     • Each question should be attempted in a separate file.
Q1: Write an assembly language program using EMU8086 syntax to perform the following
operations:
• Part A: Input User Data
Input a string representing a user’s name terminated by $. Store it in memory using Function 1
of INT 21H and register indirect addressing.
• Part B: Alternate Case Conversion
Convert every alternate character of the string to the opposite case (i.e., convert every second
letter to uppercase if lowercase, and vice versa). Use loops and logical operations.
• Part C: Count Specific Characters
Count the number of times the letters 'a', 'e', 'i', 'o', 'u' appears in the string. Store these counts
separately in memory.
• Part D: Character Frequency
Count the frequency of each unique letter in the string (considering case sensitivity) and store
this in memory.
• Part E: ASCII to Hexadecimal Conversion
Convert each ASCII character in the string to its hexadecimal value and store the results in
memory.
• Part F: Reverse Hexadecimal Conversion
Using the stored hexadecimal values from Part E, convert them back to ASCII and store the
reversed string in memory.
• Part G: Count of 1’s and 0’s Bits
For each character in the string, count the number of 1’s and 0’s bits, and store these counts
separately.
• Part H: Remove Duplicates
Remove duplicate characters from the string, leaving only the first occurrence of each character,
and store the result.
• Part I: Print Results
Print the original string, the modified string from Part B, the reversed hexadecimal string, and
the string with duplicates removed, each on a new line. Use Function 9 of INT 21H.
Q2: Create a subroutine to perform binary-to-decimal conversion for a given binary
number entered by the user.
• Part A: Allow user input for a binary number, terminated by $, and store it in memory.
• Part B: Convert the binary number to its decimal equivalent.
• Part C: Display the result using Function 9 of INT 21H.