Write a program that uses a loop to copy all the elements from an unsigned Word (16-bit) array into an unsigned doubleword (32-bit) array.
TITLE Assignment
INCLUDE Irvine32.inc
.data
Array1 WORD 5, 3, -1, 22, -15, 200, 15
Array2 DWORD LENGTHOF Array1 DUP(?)
.code
main PROC
mov ecx, LENGTHOF Array1
mov ESI, OFFSET Array1
mov EDI, OFFSET Array2
L1:
MOV EAX,0
MOV AX, [ESI]
MOV [EDI], EAX
ADD ESI, TYPE Array1
ADD EDI, TYPE Array2
Loop L1
exit
main ENDP
end main
Comments
Leave a comment