Given an array labeled as array1 with the values: 11111h, 22222h, 33333h, 44444h And another array labeled as array2 with the values: 0AEFFh, 23CAH, 1156H Sum up BOTH arrays through indirect addressing with a loop and place the sum into the EAX register. Assembly
ANSWER :
Given :
array 1 values: 11111h, 22222h, 33333h, 44444h
array 2 values: 0AEFFh, 23CAH, 1156H
Assembly Code:
lea esi,array1 ;load the address of array1 to esi
lea edi,array2 ;load the address of array2 to edi
mov eax,[esi] ;load the first number from array1 to eax
add esi,2 ;increment the address to point to the next number in array1
add eax,[esi] ;adding the second number with first number
add esi,2 ;increment the address
add eax,[esi] ;adding third number
add esi,2 ;increment the address
add eax,[esi] ;adding fourth number
add eax,[edi] ;adding first number of array2 with the sum of array1
add esi,2 ;increment the address of array2
add eax,[edi] ;adding the second number
add edi,2 ;increment the address
add eax,[edi] ;adding the third number and store the answer in register eax
hlt
**************** END ******************
Get Answers For Free
Most questions answered within 1 hours.