0% found this document useful (0 votes)
11 views

Assignment 2-1

Uploaded by

70148553
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Assignment 2-1

Uploaded by

70148553
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

The University of Lahore

Department of Computer Science& IT


Fall Term 2024
Title: Assignment 2 Due Date: 16-11-2024 23:59:59
Instructor: Muhammad Yasin Nasir Assig Date: 06-11-2024
Book: Assembly Language Programming Organization of the IBM PC by Ytha Yu
Subject: Computer Organization & Assembly Language
Selected topics from Chapter 05,06,07 particularly Controlled Structures ,
Syllabus: shifting and Rotation
Name: Roll No.

Instructions:
01. Questions are SELF EXPLANATORY. Understanding the Question is part of Solution.
02. Error in Question will be advantageous to Student.
03. Read the Questions carefully before attempting.
04. Attempt All Questions in a Precise Fashion.
05. Manage Your Time. Therefore, there will be no extension in the deadline.
06. Plagiarism may lead to F grade, so be honest.

Submission Method:
01. Assignment must be submitted individually.
02. Take print out of the given assignment. Use A4 size paper (210 × 297 millimeters or 8.27 ×
11.69 inches) to print it out. Hand-written assignment will be accepted as hard copy. Attempt
the questions on blank A4 paper.
03. Use any scanner tool to convert it to pdf. Text must have clear visibility after scanning. Blurred
pdfs will be rejected.
04. Upload the solved assignment (soft copy) at university portal before the deadline along with asm
files.
05. Submit the assignment (hard from) during the first half hour of the subsequent lecture.

Guidelines:
01. Use your official name on the SAP with first letter of each string as capital alphabets and others
as small letters.
02. Use your complete SAP ID.
03. Apply validation to each input string/number/character.
04. Use the following pattern for file name: sapID_Q1_A2.asm
05. Submit only one file of asm program.
So, you need to assemble all parts of the question in one file.

© Yasin Nasir
© Yasin Nasir

Q 1: Write an assembly language program for the given statement.


Part a: INPUT NAME: Input a name as string terminated by $ and save it in memory (Use function 1 of INT
21H, loop to implement the operation, and register indirect addressing mode to address the memory).
Part b: CASE CONVERSION: Convert the saved string’s case (capital ⇄ small) and save the string with case
conversion. (Use logical operation with loop, use based addressing mode to address the memory
locations).
Part c: VOWELS: Use part a, calculate the number of vowels in the string. (Use conditional jumps)
Part d: CONSONANTS: Use part a, calculate the number of consonants in the string. (Use conditional
jumps)
Part e: BINARY CONVERSION: Use part a, convert the saved ASCII values of whole string to binary values
and save the binary characters in the memory. (Use shift or rotate operations, use indexed addressing
mode)
Part f: HEXADECIMAL CONVERSION: Use part a, convert the saved ASCII values of whole string to
hexadecimal values and save the hexadecimal characters in the memory. (Use multiple shifts/rotate
operations along with loop)
Part g: 1’s BITS: Use part e, find the numbers of ones’ bits in the whole string. (Use indexed addressing
mode to address the memory).
Part h: 0’s BITS: Use part e, find the number of zeros’ bits in the whole string. (Use based addressing mode
to address the memory)
Part i: REVERSE THE STRING: Use part a, reverse the string and save it in the memory. (Use based and
indexed addressing mode)
Part j: WITHOUT VOWELS: Use part a & c, remove the vowels from the string and save it in the memory.
Part k: WITHOUT CONSONANTS: Use part a & d, remove the consonants from the string and save it in the
memory.
Part l: PRINTING: Print all the strings in the memory separated by new line. (Using function 9 of INT21H).

© Yasin Nasir

You might also like