When using procedures. If I have a structures like this:


V3D struct
_x real4 ?
_y real4 ?
_z real4 ?
V3D ends


I can use procedures like this


DotProduct proc, v:PTR V3D, v2:PTR V3D
mov eax, v
mov edx, v2
fld dword ptr [eax + V3D._x]
fmul dword ptr [edx + V3D._x]
fld dword ptr [eax + V3D._y]
fmul dword ptr [edx + V3D._y]
fld dword ptr [eax + V3D._z]
fmul dword ptr [edx + V3D._z]
fxch st(2)
faddp st(1), st
faddp st(1), st
DotProduct endp


And when on a debugger I can see the values of v.x and v2.x

However why is that I cannot do this?:


FACE struct
_v0 PTR V3D ?
_v1 PTR V3D ?
_v2 PTR V3D ?
FACE ends


I know that I could declare it like this:


FACE struct
_v0 dword ?
_v1 dword ?
_v2 dword ?
FACE ends


But that would not give the debugger the information needed to show the variables.

So I wonder, what is the correct way to do this?
Posted on 2001-12-21 18:03:06 by dxantos
Found a way to do it.

for a structure:


V3D struct
_x real4 ?
_y real4 ?
_z real4 ?
V3D ends


I just declare the following typedef:


LPV3D typedef ptr V3D


So I can declare:


FACE struct
v0 LPV3D ?
v1 LPV3D ?
v2 LPV3D ?
FACE ends


And it works with Visual C++ debugger :grin:
Posted on 2001-12-21 18:19:43 by dxantos