Question: This is for part B This project is divided into two parts: 1 ) Design document, and 2 ) Assembly program. In the design document

This is for part B This project is divided into two parts: 1) Design document, and 2) Assembly program. In the design document phase, you will submit a typed description of problem-solving approaches and algorithm used to solve the given problem. In the assembly program phase, you will write the class version of assembly language program to code and test the given problem.
Problem Statement:
Given a 4-digits hexadecimal number \( n \) as user input, write an assembly language program to display "T" if the first 2-digits group or the second 2-digits group number is \(\mathbf{255}5_{10}\) or if their sum is \(\mathbf{255}5_{10}\) Otherwise, the program should display the biggest 2-digits number out of the two numbers in decimal.
\( n \)(user input) will be exactly a four-digits hexadecimal number, not more and not fewer. Here are the examples:
1. Take the input \( n \)(user input) as \(\mathrm{FFO1}_{16}\) your program will first convert \(\mathrm{FF}_{16}\) to decimal equivalent "\(255_{10}\)" and convert \(01_{16}\) to decimal equivalent "\(1_{10}\)", after that your program should output " T " since one of the numbers is \(255_{10}\).
2. If \( n \)(user input) is \(46\mathrm{~B}9_{16}\), your program will first convert \(46_{16}\) to decimal equivalent "\(70_{10}\)" and convert B916 to decimal equivalent "\(185_{10}\)", and then your program should output " T " since the sum of both is a \(\mathbf{255}10\).
3. If \( n \)(user input) is \(1234_{16}\), your program will first convert \(12_{16}\) to decimal equivalent "\(18_{10}\)" and convert \(34_{15}\) to decimal equivalent "\(52_{10}\)", and then your program should output "52" since both numbers are not 25510, the sum of both is not 25510, and the biggest number of the two numbers is 52.
4. If \( n \)(user input) is \(\mathbf{A 59}\mathrm{C}_{16}\), your program will first convert \(\mathbf{A 5}\mathbf{5}_{15}\) to decimal equivalent "\(16\mathbf{5}_{10}\)" and convert \(9\mathrm{C}_{16}\) to decimal equivalent "15610", and then your program should output "165" since both numbers are not 25510, the sum of both is not 25510, and the biggest number of the two numbers is 165.
You need to take the input characters using INP in Assembler, convert the input characters into hexadecimal numbers, check the numbers and their sum, have a loop to output the number. You should not hardoode the input/output numbers and should not use the direct formula to get the result. For example, a code such as this: if (\(\mathrm{n}==0005\)) then printf("5"); is not allowed.
Hint:
The following pseudo-code demonstrates the logic for checking the equality and sum of 255 from 2-digit groups of number \( n \), where \( n \) is the given input. Please note that this program utilizes low-level functions not readily available in the assembly language, such as: conversion of ASCII-hexadecimal value to numeric-hexadecimal value, integer division, and modulus operation.
```
char hex[5]; // Array to store the 4-digit hex number (plus null terminator)
int num1, num2;
// Input 4-digit hexadecimal number
printf("Enter a 4-digit hexadecimal number: ");
scanf("%4s", hex); // Read exactly & characters
```
This is for part B This project is divided into

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!