main - Next, find the sum of list2 and put it in sum2....

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 INCLUDE Irvine32.inc .data list1 SBYTE 10, 20, -100, 33,9 sum1SBYTE 0 size1 = ($ - list1) / type list1 list2 WORD 1001h, 2002h, 3003h,6000h sum2WORD 0 size2 = ($ - list2) / type list2 list3 DWORD 12345678h, 30AA9092h, 2798h sum3DWORD 0 size3 = ($ - list3) / type list3 list4 byte 194, 212, 229 sum4word 0 size4 = ($ - list4) / type list4 .code main PROC mov ebx, 0 mov edx, 0 mov edi, 0 mov eax, 0 mov esi, 0 m mov ecx, size1 call DumpRegs c one: add al, list1[edi] add edi, type list1 loop one mov sum1, al m call DumpRegs mov ecx, size2 m two: add bx, list2[edi] add edi, type list1 loop two
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 mov sum2, bx m call DumpRegs mov ecx, size3 m three: add esi, list3[edi] add edi, type list1 loop three mov sum3, esi m call DumpRegs mov ecx, size4 mov eax, 0 m four: add dl, list4[edi] add ax, dx loop four mov sum4, ax m call DumpRegs c exit main ENDP END main
Background image of page 2
Sheet1 Page 3 CSE 2240 PROGRAM 1 Trent Moore This program calculates the sum of the three elements in list1 and stores the sum in sum1.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Next, find the sum of list2 and put it in sum2. Next, calculate the sum of list3 and place it in sum3. Finally, calculate the sum of list4 and place it in sum4. Use DumpMem to verify the correctness of your code. Be careful, summing list4 will be tricky. adds each value of list1 into al moves sum of list1 from al and stores it in sum1 adds each value of list2 into dl Sheet1 Page 4 moves sum of list2 located in dl is stored in sum2 adds each value of list3 into esi moves sum of list3 from esi and stores it in sum3 clear register eax in preperation for overflow adds each value of list2 into dl since this overflows from dl into dx, add the overflowed register(dx) to ax sum of list2 from ax(because of overflow) and stores it in sum2...
View Full Document

This note was uploaded on 04/05/2010 for the course CSE 2240 taught by Professor Staff during the Fall '08 term at Southern Methodist.

Page1 / 4

main - Next, find the sum of list2 and put it in sum2....

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online