kww228 0 Newbie Poster

Can someone help me out. I do not know how to dump the stack frame on the screen before return. This program currenlty just copies and outputs the array te the screen.

Here is what teh program has to do:
Given the data below, design an IA-32 assembly language program with a procedure to copy array X to the stack frame and dump the stack frame on the screen before return from the procedure.
.data
X sdword 10, -10, 20, -20, 30, -30, 40, -40

And here is my source code.

include irvine32.inc

addNum proto, num:ptr dword, count:dword

.data
X sdword 10,-10,20,-20,30,-30,40,-40

.code
begin:

mov esi,offset x
invoke addNum, addr x, lengthof x
invoke exitProcess, 0

addNum proc, num:ptr dword, count:dword
local array[10]:sdword

mov edi,[ebp+8] ; same as "mov edi,num"
mov ecx,[ebp+12] ; same as "mov ecx,count"

nextC:
mov eax,[edi] ; a memeber of array x copied into eax
call Writeint
add edi,4 ; next mem in x
loop nextC

ret
addNum endp
end begin

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.