Quiz 5

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

Info iconThis 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
Background 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

This test prep was uploaded on 04/20/2008 for the course EE 3750 taught by Professor Desouza during the Spring '08 term at LSU.

Ask a homework question - tutors are online