Question: data # Data segment Array A: .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Array B: .word #Array -space 40 text

data # Data segment Array A: .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Array B: .word #Array -space 40 text #Code#Print Integers in hex, binary, etc PrintInteger(%n, %m) .inacro li $v0,%n move $20, %m syscall .end_macro.globl Main Main: PrintAnyStringMessage(Statement: Statement: Recode the above program to do the following task: Array_ A[k] =20* Array A[k] -

data # Data segment Array A: .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Array B: .word #Array -space 40 text #Code Segment .egy Pointer $t0 # Sto remanmed as Pointer .eqv offset St1 # $t1 renamed as offset .eqv BaseAddressRegA St4 # St4 renamed as BaseAddress Rega .eqv BaseAddressRegB St5 # $t5 renamed as BaseAddressRegB eqy Effective AddressA $t6 # St renamed as EffectiveAddressA .eqy Effective AddressB St7 # $17 renamed as Effective AddressB #Array A with imtial values B is empty and is 10 word wide, 40 bytes space allocated # Print Any Arbitrary String Message .macro PrintAnyStringMessage (message) .data ArbitraryMessage: .asciiz %message #Empty space reserved to hold 40 letters .space 40 .text li $v0, 4 # Code to print character or srting message la $a0, ArbitraryMessage #Base address loaded into $a0 # Print message syscall .end_macro #Print Integers in hex, binary, etc PrintInteger(%n, %m) .inacro li $v0,%n move $20, %m syscall .end_macro .globl Main Main: PrintAnyStringMessage("Dr. Farmanullah Jan Says Welcome to Assembly Programming Session! ") PrintAnyStringMessage("Perform: Array_B= Array_A+ 10 Using a for-loop! ") li Pointer, 0 #Clear Pointer li offset, 0 #Clear offset la BaseAddressRegA, Array_A #Base address of Array_A is loaded into "BaseAddressRega" la BaseAddressRegB, Array_B #Base address of Array_B is loaded into "BaseAddressRegB" For Loop: add Effective AddressA, BaseAddressRegA, offset add EffectiveAddressB, BaseAddressRegB, offset lw $t8, 0(Effective AddressA) # $18 Statement: Statement: Recode the above program to do the following task: Array_ A[k] =20* Array A[k] - 2*Array_B[k]; for k=0-20 Note: All = {0,1, 2,3,..., 19} Code: B[] A[]; Both sets are same. =

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The task is to adjust the given MIPS assembly language program in the images to perform a new operation on two arrays A and B As per the statement the ... View full answer

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