I've been trying to put a struct like this in the data segment

Posted on 2006-02-14 21:13:29 by XCHG
TASM syntax:

struc TPoint
  x  db ?
  y  db ?
ends TPoint


db - declare byte (8-bit)
dw - declare word (16-bit)
dd - declare doubleword (32-bit)
dq - declare quadword (64-bit)
dt - declare ten bytes (80-bit)

You can also declare predefined structures.

BTW: The POINT structure is already defined by the platform SDK (it's inside the win32.inc), but it's using 32-bit members. Given that fact, you can define your TPoint structure in the following way:
TPoint equ <POINT>

(of course assuming that you want to use 32-bit members)
Posted on 2006-02-14 22:47:50 by ti_mo_n
TPoint STRUC
tpoint_x dd ?
tpoint_y dd ?
ENDS

Notice that "STRUC" is without a finishing "T".
Because in MASM emulation mode TASM's structure members are global in scope (unlike MASM itself) you have to assure unique names ;) In IDEAL mode you can use the syntax presented by ti_mo_n.
Posted on 2006-02-15 01:30:11 by BogdanOntanu
oh yeah i just figured that out after i posted in here, but anyway, thanks a lot.
Posted on 2006-02-15 04:47:13 by XCHG