0

Let's say I have to copy and array, call it X, to the Stack frame. and then display that stack frame on the screen before exiting from the procedure. How would I copy that array to a stack frame. I came up with this but it isn't working.

    .data
     X  sdword   10, -10, 20, -20
    .code
    begin:
    mov esi,[ebp+8]
    mov edi,[ebp+12]
    mov ecx,[ebp+20]
    mov edx,[ebp+16]

So how would you add the array X into the stack frame using EBP. I'm not using irvine or anything. just .386 .MODEL flat, stdcall
.STACK 4096

I'm using Microsoft Visual C++

Praxeolitic
  • 22,455
  • 16
  • 75
  • 126

1 Answers1

0

Its not clear if you need to copy the CONTENTS (i.e. 4 words) into the stack from, or just the ADDRESS. Either way, you make room on the frame for whatever it is you need to put there, and then copy it the same way you do any memory-to-memory copy.

Scott Hunter
  • 48,888
  • 12
  • 60
  • 101