{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Quiz 5 - MOV EAX 0 clear register for ADD function least...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Quiz 5 Write a program segment to ad all the elements of the LIST array defined below, and store the result in the variable SUM. LIST DQ 1, 111222333444, 256, 999888777666 SUM DQ 0 *use a loop to do this, use add instruction to add least significant 32 bits. *Cannot not add list to SUM. Must add to a register. NO memory to memory addition. MOV ECX, 4 loop counter
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MOV EAX, 0 clear register for ADD function least significant bit MOV EDX, 0 store most significant bit MOV ESI, 0 number of elements of array AGAIN: ADD EAX, LIST[SI*8] scaling factor is 8 b/c 64 bits least significant bits ADC EDX, LIST[SI*8 + 4] for most significant bit with carry INC SI LOOP AGAIN MOV SUM, EAX, MOV SUM + 4, EDX...
View Full Document

{[ snackBarMessage ]}