Question: You are to design, write, assemble, and simulate an assembly language programwhich will multiply two 8 - bit numbers, NUM 1 and NUM 2 ,
You are to design, write, assemble, and simulate an assembly language programwhich will multiply
two bit numbers, NUM and NUM by adding NUM to itself NUM times. Both of these numbers
are UNSIGNED nonnegative numbers. The result will be a bit number to be stored in RESULT
in BIGENDIAN format. For example, your numbers could be and and the product would
then be $FEin hex
PLEASE NOTE:
Your program should work for any NUM and NUM values, not just the ones given.
You are NOT allowed to use the MUL instruction anywhere in your program; you need to use the
abovementioned addition algorithm instead.
Your program is NOT allowed to change the number stored in NUM or NUM
You have to use the program skeleton provided for Lab Do not change the data section or you
will lose points! This means: do not change the 'ORG $B and 'ORG $B statements, or
'NUM FCB and 'NUM FCB You are allowed to change the values assigned to NUM and
NUM to simulate different numbers. If you need to define additional variables, please add them
after the 'RESULT RMB statement.
You must terminate your program correctly using the STOP instruction as shown in class.
The program must only have one exit point ie only one STOP instruction at the end of the
program is allowed
You do not have to optimize your algorithm or your assembly program for speed.
You have to provide a pseudocode solution. In your pseudo code, do NOT use a for loop, but
either a while or a dountil structure to implement a loop. Also, do NOT use any gotobreak
exit or return statements in your pseudocode.
The structure of your assembly program should match the structure of your pseudo code to
eg if the pseudo code shows a while structure, your assembly program should also have a while
structure
Make sure that you implement any ifthen, ifthenelse, while, or dountil structures the way you
learned it in class. Incorrectly implemented structures will result in points lost.
Any assembler or simulator errorwarning messages appearing when assemblingsimulating your
submitted program will result in up to points lost.
You should test your program with at least five sets of decimal data:
A NUM: NUM: RESULT $FE
B NUM: NUM: RESULT $F
C NUM: NUM: RESULT $F
D NUM: NUM: RESULT $
E NUM: NUM: RESULT $
PLEASE NOTE: Your program will be tested by us using random number pairs. If your program does
not produce a correct result for those random pairs, you will lose up to points see grading
guidelines below
Your program should include a header containing your name, student number, the date you wrote the
program, and the lab assignment number. Furthermore, the header should include the purpose of the
program and the pseudocode solution of the problem. At least of the instructions should have
meaningful comments included not just what the instruction does; eg don't say "increment the
register A which is obvious from the INCA instruction; say something like "increment the loop
counter" or whatever this incrementing does in your program. Alternatively, you can use your pseudo
code to comment instructions as was shown in class. You can ONLY use branch labels related to
structured programming, ie labels like IF IF THEN, ELSE, ENDIF, WHILE, ENDWHL,
DOUNTL, DONE, etc. DO NOT use labels like LOOP, JOE, etc. Remember: labels need to be
unique. So for example, if you have two ifthen structures, you should use the labels IFTHEN,
ENDIF for the first structure and IFTHEN ENDIF for the second one.
Please base the code off of this C program. we are supposed to follow line by line
#include
int main
int NUM; Example value, change as needed for testing
int NUM; Example value, change as needed for testing
int RESULT ; To store the multiplication result
While loop to add NUM to itself NUM times without an explicit counter
while NUM
RESULT NUM;
NUM;
Print the result
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
