MASM32 is ignoring the first data address in the in-process stack

Viewed 38

I created the following process:

labOne PROC USES esi eax ebx ecx edi, pX1:DWORD, pY1:PTR DWORD, pY2:PTR DWORD, pY3:PTR DWORD, pY4:PTR DWORD

And when I move the pX1 address into the esi register, it moves the address of pY1. When I move to register pY1, it moves address of pY2 and so on.

It seems like addresses are being shifted.

Also, pY4 returns a random address.

Here is PROTO of labOne:

labOne PROTO, :dword, :PTR dword, :PTR dword, :PTR dword, :PTR dword

INVOKE:

INVOKE labOne, ADDR X, ADDR Y1, ADDR Y2, ADDR Y3, ADDR Y4

.data:

X dd 32127212h, 43121153h, 21344214h, 0064216340h, 23243245h, 51542145h
Y1 dd 6 DUP(0FFFFFFFFh)
Y2 dd 6 DUP(0FFFFFFFFh)
Y3 dd 6 DUP(0FFFFFFFFh)
Y4 dd 6 DUP(0FFFFFFFFh)

mov esi, pX1 screen

addresses Help please, maybe I didn't notice something?

1 Answers

Problem was that I used

.386
.model medium, stdcall 

instead of

.686
.model flat, stdcall
Related