I have code that goes something like the following:

struc FileOutputStream handle
{
.vtable dw vtableFileOutputStream
.handle dw handle
.flags dw 0
.CLOSED_FLAG = 0001h
}


then a little later:

mov ,ax

That line doesn't compile. I get the message:

fasm.tmp2 [62]:
mov ,ax
error: undefined symbol.

How do I access a member of a structure that is pointed to by a register, as in the example?

Thanks!

-- Craig Putnam
Posted on 2003-04-03 21:30:15 by PopeInnocent
So, struc description is only "description" it's not real label. You have 2 ways:




1:
struc FileOutputStream handle
{
.vtable dw vtableFileOutputStream
.handle dw handle
.flags dw 0
.CLOSED_FLAG = 0001h
}

virtual at 0
FileOutputStream FileOutputStream ?
end virtual

mov [bx+FileOutputStream.handle],ax

****************************************
or 2:

struc FileOutputStream handle
{
.vtable dw vtableFileOutputStream
.handle dw handle
.flags dw 0
.CLOSED_FLAG = 0001h
}

virtual at bx
FileOutputStream FileOutputStream ?
end virtual

mov [FileOutputStream.handle],ax


And: "vtableFileOutputStream" - I hope, you defined this somewhere.
Posted on 2003-04-03 21:53:08 by JohnFound