- #1
Fatima Hasan
- 319
- 14
Homework Statement
Calculate the sum of all hight-order bytes in array NUM1 and store the sum in a memory location named newH. Define newH as needed.
Homework Equations
-
The Attempt at a Solution
Code:
INCLUDE Irvine32.inc
.data
NUM1 sword 1h,2h,3h,4h,5h,6h,7h,8h,9h,10h,11h,12h,13h,14h,15h,16h
newH sdword 0
.code
main PROC
; The sum of all hight-order bytes in array NUM1
mov ecx,16
mov esi,0
L2: movsx eax,NUM1[2*esi+1]
add newH,eax
inc esi
loop L2
exit
main ENDP
END main
Last edited by a moderator: