Copying a Word Array to a Double Word Array Write a program

Copying a Word Array to a Double Word Array

Write a program that uses a loop to copy all the elements from an unsigned Word (16-bit) array into an unsigned double word (32-bit) array.

Test your program with other values, such as nonnegative and negative integers and characters in UNICODE representing a string. Comment on what you find.

Solution

%include \'Functions.asm\'

section .data

wordArray dw 0, 1, 2, 3, 4, 5

length equ $-wordArray

ddArray dd 0, 1, 2, 3, 4, 5

section .text

global main

main:

mov ebp, esp; for correct debugging

mov esi, wordArray

mov edi, ddArray

mov ecx, 0

convert:

mov bx, [esi + ecx * 2]

movzx edi, bx

inc ecx

cmp ecx, length

jne convert

mov eax, ddArray

call intLineFeed

call exit

Copying a Word Array to a Double Word Array Write a program that uses a loop to copy all the elements from an unsigned Word (16-bit) array into an unsigned doub

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site