[go: up one dir, main page]

0% found this document useful (0 votes)
370 views2 pages

Assignment 3

This document outlines three questions for an assembly language assignment. Question 1 (10 marks) asks to write code that isolates the hour, minute, and second bits from the system time returned by MS-DOS function 2Ch and displays the time. Question 2 (20 marks) asks to write a procedure that checks if two strings contain the same characters irrespective of case. Question 3 (20 marks) asks to write a program that checks if a user-input number between 1 and 100 is a perfect number by determining if the sum of its factors equals the number. The procedure should print the factors of any perfect numbers found. Submission guidelines require submitting the codes for each question in separate text files within a folder named with the student's roll

Uploaded by

usman khan
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)
370 views2 pages

Assignment 3

This document outlines three questions for an assembly language assignment. Question 1 (10 marks) asks to write code that isolates the hour, minute, and second bits from the system time returned by MS-DOS function 2Ch and displays the time. Question 2 (20 marks) asks to write a procedure that checks if two strings contain the same characters irrespective of case. Question 3 (20 marks) asks to write a program that checks if a user-input number between 1 and 100 is a perfect number by determining if the sum of its factors equals the number. The procedure should print the factors of any perfect numbers found. Submission guidelines require submitting the codes for each question in separate text files within a folder named with the student's roll

Uploaded by

usman khan
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

COAL Lab 2019 Due Date: 27th Oct, 2019

Assignment 03

10 marks
Question 1:
MS-DOS function 2Ch returns system time in CX register. This function packs the Hour,
Minute and Second into 16-bits using following format.
Second: Bit No. 0-5,
Minute: Bit No. 6-11 and
Hour: Bit No. 12-15
To get current time of system following code is used:
mov ah, 2Ch
int 21h

Write an assembly language code that isolates hour, minute and second bits appropriately
and display the system time on console.

20 marks

Question 2:
Write an assembly language procedure named “equalsIgnoreCase”, which receives two
strings and their sizes, and returns true if the two strings contain the same characters
irrespective of the case.
For example, for strings {“aBc”} and {“Abc”} the function returns true, but for {“aBc”}
and {“aB”}, or {“aBc”} and {“Xbz”}, the function returns false.
Write a generic procedure that must handle all checks and conditions.

20 marks

Question 3:
Perfect Numbers: An integer is said to be a perfect number if the sum of its factors,
including 1 (but not the number itself), is equal to the number. For instance, 6 is a perfect
number (6 = 1 + 2 + 3).
Write an assembly language program to check whether an input number is perfect or not.
Your main procedure should ask the user to input a number. Input-Number should be
between 1 and 100. Now pass this number to a procedure named “perfect”.
Procedure ‘perfect’ should determine whether the parameter is a perfect number or not. It
should also print all factors of a perfect number. Use stack addressing to store factors of a
perfect number. You are not allowed to use array to store factors of a perfect number.

Submission Guidelines:
• Submit a folder having three .txt files. i.e. Q1.txt, Q2.txt and Q3.txt
• If your Roll no. is 18i-1716, your folder name should be 18_1716.
• Do not compress your folder: zip, rar et cetera.
• Your codes should be compatible with masm615 (available on Slate).
• Late submissions will not be accepted.
• Email submissions will not be accepted.
• You’ll get 10 marks for following these guidelines and neg 10 marks for not doing so.
• Plagiarism will result in neg 5 abs marks.

You might also like