0% found this document useful (0 votes)
132 views

Program For Copying A Word Array To A DoubleWord Array in Assembly Langauge Using Visual Studio PDF

Uploaded by

Dilawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

Program For Copying A Word Array To A DoubleWord Array in Assembly Langauge Using Visual Studio PDF

Uploaded by

Dilawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

12/9/2018 4.

Program for Copying a Word Array to a DoubleWord array in Assembly Langauge using Visual Studio

Programming Tutorials
SUBSCRIBE

Gana un dinero extra


Comparte tu espacio cuando y como quieras. Descubre cuánto MÁS INFORMACIÓN
puedes ganar con Airbnb.

4. Program for Copying a Word Array to a


DoubleWord array in Assembly Langauge
using Visual Studio
December 13, 2017

Chapter 4

Data Transfers, Addressing, and Arithmetic

Assembly Language Programming Exercise

Problem # 4:

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.

Solution:

.386

.model flat,stdcall
.stack 4096

ExitProcess PROTO, dwExitCode:DWORD

.data

array WORD 0,2,5,9,10

newArray DWORD LENGTHOF array DUP(?)


.code

main PROC

mov ecx, LENGTHOF array


mov ESI, OFFSET array

mov EDI, OFFSET newArray

http://csprogrammingtutorial.blogspot.com/2017/12/Copying-a-Word-Array-to-a-DoubleWord-array.html 1/3
12/9/2018 4. Program for Copying a Word Array to a DoubleWord array in Assembly Langauge using Visual Studio

L1:
Programming Tutorials
MOV EAX,0
SUBSCRIBE
MOV AX,[ESI]

MOV [EDI], EAX

ADD ESI, TYPE array


ADD EDI, TYPE newArray

Loop L1

INVOKE ExitProcess,0

main ENDP

END main

Let me know in the comment sec on if you have any ques on.

Previous Post:

Summing the Gaps between Array Values

Next Post:
Fibonacci Numbers

ASSEMBLY BASICS ASSEMBLY LANGUAGE FOR X86 PROCESSORS CHAPTER 4

COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE COMPUTER SCIENCE

DATA TRANSFERS ADDRESSING AND ARITHMETIC EXERCISE SOLUTION VISUAL STUDIO

Reactions: funny (0) interesting (0) cool (0)

Gana un dinero extra


Comparte tu espacio cuando y como quieras. Descubre cuánto
puedes ganar con Airbnb.

http://csprogrammingtutorial.blogspot.com/2017/12/Copying-a-Word-Array-to-a-DoubleWord-array.html 2/3

You might also like