Question: Given a 4 - digits hexadecimal number n as user input, write an assembly language program to display T if the first 2 - digits
Given a digits hexadecimal number n as user input, write an assembly language program to display T if the first digits group or the second digits group number is or if their sum is Otherwise, the program should display the biggest digits number out of the two numbers in decimal. n user input will be exactly a fourdigits hexadecimal number, not more and not fewer. Here are the examples: Take the input n user input as FF your program will first convert FF to decimal equivalent and convert to decimal equivalent after that your program should output T since one of the numbers is If n user input is B your program will first convert to decimal equivalent and convert B to decimal equivalent and then your program should output T since the sum of both is a If n user input is your program will first convert to decimal equivalent and convert to decimal equivalent and then your program should output since both numbers are not the sum of both is not and the biggest number of the two numbers is If n user input is AC your program will first convert A to decimal equivalent and convert C to decimal equivalent and then your program should output since both numbers are not the sum of both is not and the biggest number of the two numbers is 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 hardcode the inputoutput numbers and should not use the direct formula to get the result. For example, a code such as this: if n then printf; is not allowed. Submit an assembly program to solve the given problem. To get started, you need to download and run the assembler simulator Assemblerjar from Canvas. The instructions to download, run the simulator then compile and run the code are specified in the Helpful Resource section below. Your program should be stored in a plain text file and able to be executed on the simulator. Grading criteria for the Assembly Program Worth of the project Critical Elements Percentage Distribution Well Commented Code Variable initialization Get input N from user Converting N to two numbers Correctness of output in showing the biggest number or TTotal Again, in the project you must use loop functionality to achieve the output. Predefined values or answers in the code are NOT accepted. There are three groups of instructions in this assembler:
Memory Reference Instructions
Non memory Reference Instructions
Pseudo Instructions ie Assembler directive instructions
Memory Reference Instructions MRI
Direct Addressing: opcode operand eg ADD num
Memory word at location 'num' is added to accumulator AC ie AC
AC Mnum;
Here, effective address of the operand is 'num'
Indirect Addressing: opcode operand I eg ADD num I
Memory word of memory word at location 'num' is added to AC ie
AC AC Mnum
Here, effective address of the operand is Mnum
MRI Instructions: In the following, addr denotes effective address.
AND xxx AND xxx I
Logical AND of effective memory word to AC ie
AC AC and Maddr;
ADD xxx ADD xxx I
Add effective memory word to AC
ie AC AC Maddr;
LDA xxx LDA xxx I
Load effective memory word to AC
ie AC Maddr;
STA xxx STA xxx I
Store content of AC to effective memory word. ie
Maddr AC;
BUN xxx BUN xxx I
Branch, unconditionally, to effective address. ie
PC addr;
BSA xxx BSA xxx I
Address of next instruction ie PC is stored in effective memory word. Then, execute
the instruction following the effective address.
ie Maddr PC; PC addr ;
Note: BSA is useful to save the return address and to branch to a procedure.
ISZ xxx ISZ xxx I
Increment memory word. If incremented value is increment PC ie skip next instruction
ie Maddr Maddr; if Maddr PC PC ;
Note: ISZ is used to count iterative loops.
NonMemory Reference Instructions
These instructions do not have the operand part or the addressing mode.
CLA Clear AC
CLE Clear E the extended bit of AC
CMA Complement AC
CME Complement E
CIR Circular shift to the Right on AC and E
CIL Circular shift to the Left on AC and E
INC Increment AC
SPA Skip next instruction, if AC is Positive, ie if AC PC PC ;
SNA Skip next instruction, if AC is Negative, ie if AC PC PC ;
SZA Skip next instruction, if AC is Zero, ie if AC PC PC ;
Note: SPA, SNA, and SZA are used in conditional branching.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
