Answer to Question #208873 in Assembler for qamar zaib

Question #208873

 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. 


1
Expert's answer
2021-06-20T08:12:14-0400
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS