Assume that an array has been initialized with integers, where the array location is in…
Jump to turn (7)
- 1Assume that an array has been initialized with integers, where the array locatio
- 2come up with a solution without using sll bltz and bgtz
- 3Assume that an array has been initialized with integers, where the array locatio
- 4forget everything I said before
- 5Assume that an array has been initialized with integers, where the array locatio
- 6do have to include .text and .global main?
- 7when I run this coded I don't get any result
- User
Assume that an array has been initialized with integers, where the array location is in register 2. Write an assembly program that updates the contents of the array as follows: • negative numbers are replaced by the square of the number • positive numbers are replaced by 10 times the number • zero is unchanged You should not avoid using registers by temporarily saving values to memory. Memory access with the lw and sw instructions is very slow compared to accessing data in registers, so it would be counter-productive to save a value to memory rather than use a register.