Question

TITle Addition of two lists ; Proj1.asm ; This program add elements of two lists separately, display their sums, then exchang

No. 2 (50 points) Use a loop with indirect or indexed addressing to reverse the elements of an integer array in place. Do not

TITle Addition of two lists ; Proj1.asm ; This program add elements of two lists separately, display their sums, then exchange two sums, and display then againe INCLUDE Irvine32.inc data list1 WORD 1eh, 20h, 30h list2 NORD 10h, 20h, 38h, 48h suml WoRD? sun2 WORD? code main PROc mov ax, [list1] add ax, [list1+2] add ax, [list1+4] mov sumi, ax call DumpRegs nov bx, [list2] add bx, [list2+2 add bx, [list2+4) add bx, [list2.6] nov sum2, bx call DumpRegs xchg ax, bx call DumpRegs exit main ENDP END main
No. 2 (50 points) Use a loop with indirect or indexed addressing to reverse the elements of an integer array in place. Do not copy the elements to any other array. Use the SIZEOF, TYPE, and LENGTHOF operators to make the program as flexible as possible if the array size and type should be changed in the future. Display the modified array by calling the DumpMem. Add adequate documentations. Turn in your program codes and screen shots.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The following program uses indirect addressing to reverse the elements of an integer array in place without copying the elements to any other array as required by you.

main PROC:

MOV SI , 0500H MOV DI , 0505H MOV CH, 03H MOV AL , [SI] : L1 MOV BL , [DI] MOV [DI] , AL MOV [SI] , BL INC SI DEC DI        DEC CH    JNZ L1    HLT

Write the memory location of the 4th statement in place of L1 at the second last command. You can add other statements too to make it more flexible but do not remove 4th-10th statements just edit if required.

I hope it helps :)   

Add a comment
Know the answer?
Add Answer to:
TITle Addition of two lists ; Proj1.asm ; This program add elements of two lists separately, disp...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PART1 Answer the following question in a Word document named as SP2019LAB7 PART1 YourlastName.doc...

    what's the solution for the c++ project? PART1 Answer the following question in a Word document named as SP2019LAB7 PART1 YourlastName.docx Question1: What is the output of the following program? #include <iostream> using namespace std; int main() int count; int alpha(51: alpha[0] -4; for (count 1; count <5; count++) alpha[count] = 4 * count + 1 alpha(count 1] alpha[counk] -8; LAB7 cout << List elements: "; for (count = 0; count < 5; count++) cout <s alphalcount]<<"" cout<s endl; return...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT