Page 1 of 1

in MIPS like an assembly language not in a C or any other higher-level language. Write a function 𝐴𝑉𝐴(&𝑋,&𝑌,&𝑍,𝑛,𝑠,𝑡) to

Posted: Fri Jul 01, 2022 5:41 am
by answerhappygod
in MIPS like an assembly language not in a C or any otherhigher-level language.
Write a function 𝐴𝑉𝐴(&𝑋,&π‘Œ,&𝑍,𝑛,𝑠,𝑑) to perform thefollowing absolute value vector addition, such that 𝑋𝑖=|π‘Œπ‘–|+|𝑍𝑖|+2×𝑠+𝑑; π‘“π‘œπ‘Ÿ 0≀𝑖 β‰€π‘›βˆ’1 where &𝑋,&π‘Œ, and &𝑍refer to the array 𝑋,π‘Œ,𝑍’s starting address, 𝑛 is the size of thearray, and 𝑠 and 𝑑 are integers. Please use the stack to pass thesesix parameters. Also, write main programs that call the 𝐴𝑉𝐴function on the following data sets (note: please prepare twoseparate program files, one for each data set) β€’ 𝑛 = 5, 𝑠=2, 𝑑=1, π‘Œ= {1, 2, 3, 4, 5}, and 𝑍 = {βˆ’5,βˆ’4,βˆ’3,βˆ’2,βˆ’1} β€’ 𝑛=10, 𝑠=3, 𝑑=2,π‘Œ={βˆ’1, 3, βˆ’5, 7, βˆ’9, 2, βˆ’4, 6, βˆ’8, 10}, and 𝑍={1,2,3,4,5,6,7,8,9,10} (For each data set, the main program shouldfirst print out π‘Œ and 𝑍 arrays, and then to calculate 𝑋, andfinally prints out 𝑋 array.)