Question: Using Assembly Language for x86 Processors 7th Edition Create a procedure called sumOddEven that will produce the sum of both the odd and even numbers.

Using Assembly Language for x86 Processors 7th Edition

Create a procedure called sumOddEven that will produce the sum of both the odd and even numbers. This means you will have to pass two variables to the procedure by reference. Make sure that the code you submit has all three procedures in it. It is not enough to simply submit the sumOddEven procedure.

The following are two procedures. One procedure fills a 2D array and the other prints out a 2D array.

ExitProcess proto,dwExitCode:dword

fill2DArray PROTO,

myArray: PTR DWORD,

cLength: DWORD,

rLength: DWORD

print2DArray PROTO,

myArray: PTR DWORD,

cLength: DWORD,

rLength: DWORD

.data ;// write your data in this section

Array DWORD 20 DUP(?)

.code ;// write your program here

main proc

INVOKE fill2DArray,

ADDR Array,

5,

4

INVOKE print2DArray,

ADDR Array,

5,

4

invoke ExitProcess,0

main endp

fill2DArray PROC,

myArray: PTR DWORD,

cLength: DWORD,

rLength: DWORD

mov ecx, rLength

mov edi, myArray

ROW:

push ecx

mov ecx, cLength

COL:

mov eax, 100

call RandomRange

add eax, 1

mov [edi], eax

add edi, 4

loop COL

pop ecx

loop ROW

ret

fill2DArray ENDP

print2DArray PROC,

myArray: PTR DWORD,

cLength: DWORD,

rLength: DWORD

mov ecx, rLength

mov edi, myArray

ROW:

push ecx

mov ecx, cLength

COL:

mov eax, [edi]

call WriteDec

mov al, 09h

call WriteChar

add edi, 4

loop COL

pop ecx

call Crlf

loop ROW

ret

print2DArray ENDP

end main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!