Lab Task: Conditional Structures in Assembly Language
Course Code: CS-311
Course Title: Computer Organization and Assembly Language
Semester: 5th
Library Used: Irvine32.inc
Tools Required: MASM (Microsoft Macro Assembler)
Register Restriction: Only use EAX, EBX, ECX, EDX
🔧 Objective:
To implement conditional structures in Assembly Language using MASM and the Irvine32
library. These tasks aim to develop logical thinking and control flow understanding using low-
level programming.
� Lab Tasks:
Task 1: Even or Odd
Write a program that checks whether an input number is even or odd.
Task 2: Maximum of Two Numbers
Write a program to input two integers and display the greater one.
Task 3: Minimum of Two Numbers
Write a program to input two integers and display the smaller one.
Task 4: Positive, Negative, or Zero
Write a program to check whether a number is positive, negative, or zero.
Task 5: Grade Assignment
Input a number between 0–100 and assign a grade:
A: 90–100
B: 80–89
C: 70–79
D: 60–69
F: <60
Task 6: Leap Year Checker
Write a program to check if a given year is a leap year (divisible by 4).
Task 7: Divisible by 3 and 5
Write a program to check if a number is divisible by 3, 5, both, or neither.
Task 8: Vowel or Consonant
Write a program to input a character and check whether it is a vowel or consonant.
Task 9: Number Within a Range
Write a program to verify whether the given number lies between 50 and 100 (inclusive).
Task 10: Largest of Three Numbers
Write a program to input three integers and display the largest.
Task 11: Smallest of Three Numbers
Write a program to input three integers and display the smallest.
Task 12: Prime Number (Simplified)
Write a program to check whether a number (up to 100) is prime using basic logic.
Task 13: Uppercase or Lowercase
Write a program to check if an input character is uppercase or lowercase.
Task 14: Absolute Value
Write a program to compute and display the absolute value of a number.
Task 15: Multiple Checker
Write a program to check whether one number is a multiple of another.
Task 16: Odd Number in Range
Write a program to check whether a number is odd and lies between 1 and 99.
Task 17: Voting Eligibility
Write a program to input age and determine if the user is eligible to vote (age ≥ 18).
Task 18: Triangle Validity
Write a program to input three sides and check whether they can form a valid triangle.
Task 19: 2-Digit Palindrome
Write a program to check if a 2-digit number is a palindrome (e.g., 44, 99).
Task 20: Temperature Check
Write a program to take temperature input and print:
"Cold" if < 10
"Warm" if between 10–25
"Hot" if > 25
📌 Notes:
Only use the allowed general-purpose registers.
Use Irvine32.inc procedures for input/output.
Comment each logical block clearly in your code.
Test each program thoroughly with valid and edge-case inputs.