flat assembler
Message board for the users of flat assembler.
Index
> Main > Why Undefined symbol??? |
Author |
|
Chijik 04 Feb 2004, 11:38
struc _b
{ .b1 db 0 } mov ax,_b.b1 ;Error:Undefined symbol!!! )) |
|||
04 Feb 2004, 11:38 |
|
Chijik 04 Feb 2004, 12:13
Because "struc" does not define any labels. It simply defines some "shape" for defining data.
So, working with dymamic data is not possible Sit down. 2. |
|||
04 Feb 2004, 12:13 |
|
JohnFound 04 Feb 2004, 12:57
Chijik wrote: So, working with dymamic data is not possible Wrong answer, young man! Of course you can use dynamic data with structures without any problem. I do it all the time. Look below: Code: struc TMyData { .field1 dd ? .field2 dd ? } ; for easy use of following construction there is a macro "struct" ; in FASM standard macro library. ; if you want to use "struct" macro, use: ; ; struct TMyData instead of virtual statement. ; virtual at 0 TMyData TMyData sizeof.TMyData = $ end virtual ; allocate some dynamic memory for array... invoke GetProcessHeap invoke HeapAlloc, eax, 0, 1000 * sizeof.TMyData mov esi, eax xor eax, eax ; Then use it as array of TMyData structures... .fillloop: mov [esi+eax+TMyData.field1], eax mov [esi+eax+TMyData.field1], 1234h add eax, sizeof.TMyData cmp eax, 1000*sizeof.TMyData jne .fillloop ;.... |
|||
04 Feb 2004, 12:57 |
|
vid 04 Feb 2004, 19:10
you should read fasm's docs more carefully:
struc is like macro, only difference is that used struc must be preceded by label, which is then appended before any symbol starting with '.' in struc. To define labels, you should create one virtual structure (virtual = no data really gets defined, only labels are), with name preceding structure same as structure name. thus you'll get names for dynamic access you wanted. |
|||
04 Feb 2004, 19:10 |
|
comrade 04 Feb 2004, 21:45
there is standard struct macro for this
|
|||
04 Feb 2004, 21:45 |
|
Chijik 05 Feb 2004, 12:55
[quote="JohnFound"]
Chijik wrote: So, working with dymamic data is not possible Wrong answer, young man! Of course you can use dynamic data with structures without any problem. I do it all the time. Look below: Through anus... Ok, thank you. |
|||
05 Feb 2004, 12:55 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.