Question: Task 2 - Vector addition 2 points - Write a macro program that adds two two - component vectors. The two vectors should first be
Task Vector addition
points Write a macro program that adds two twocomponent vectors. The two vectors should first be stored as
pairs of numbers on the stack, the addition function clears these and stores the result on the stack.
Start with the following approach for the two vectors and and the sum :
main
BIPUSH
BIPUSH
BIPUSH
BIPUSH
endmain
points Now extend the instruction set microcode to include vector addition. The name of the function should
be IVECADD and it should not have any parameters; the vectors are passed via the stack.
The value Value corresponds to the line in the microprogram in which the first line of the implementation is
located. Precede the first line with a hexadecimal value in brackets that corresponds to the previous Value The
function will be in this line after compilation. This value should be unique in the microprogram, otherwise you will
receive an error message.
By calling the stack, the last four words on the stack from bottom to top: Vectorx Vectory Vectorx Vectory
should be replaced by the two words of the solution. After a call, the original vectors are gone! THIS IS A MIC CODE
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
