程序代写代做 assembler algorithm CNSCC.150 ASSEMBLER COURSEWORK

CNSCC.150 ASSEMBLER COURSEWORK
The task for this practical is to write an assembler program which can multiply two integer numbers. However, the program should not use the multi instruction to accomplish this. Instead, the program should perform the multiplication using the Ethiopian Multiplication (also known under other names). Multiplication of two numbers is achieved using shift operations and simple addition. The next sections detail how the Ethiopian multiplication works and define the requirements of the program. Make sure that ALL program requirements are implemented as stated.

ASSIGNMENT ASSESSMENT (1)
• The Ethiopian Multiplication should be carried out in a procedure
• The procedure argument $a0 is the address of the array containing a, b and result
• The procedure returns either 0 (multiplication error, result in array invalid) or 1 (multiplication ok, result available in array) in $v0
• The procedure can handle 16 bit 2’s complement values for a and b
• The procedure should return 0 if a or b are larger than 16bit
• The multiplication result is a 32bit 2’s complement number
• The multiplication result should be printed on screen using a syscall within the main program
ASSIGNMENT ASSESSMENT (2)
• Make sure you have implemented the requirements (see previous slide)

• Code should also be documented and of good structure (readable code)
• Make sure you tested your program with a variety of inputs (different numbers for multiplication)
• The MARS default extension is “.asm”, but the file you upload must end in “.txt”. All codes should be in one file. Submit your code to Moodle before the deadline.
. You can add some new feature or function in your implementation.
ASSESSMENT PROCESS
• I talk to each one of you individually, for around 5 minutes.
• You should quickly describe your source code and run a few examples. • I may ask questions about your code and your algorithm:
– To help us understand you implementation
– To ensure that you have understood what you have done