Question: Task 2 - Vector addition 2 points - Write a macro program that adds two two - component vectors. The two vectors should first be

Task 2- Vector addition
2 points - Write a macro program that adds two two-component 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 (104) and (32) and the sum (136) :
.main
BIPUSH 10
BIPUSH 4
BIPUSH 3
BIPUSH 2
.end-main
6 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 1 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 Value1. 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: Vector1.x Vector1.y Vector2.x Vector2.y)
should be replaced by the two words of the solution. After a call, the original vectors are gone! THIS IS A MIC1 CODE

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 Databases Questions!