1.public question:
I have many var to declare,but I can only do as fllows
public var1
public var2
.....
can I do:
public var1,var2........?

It semms I still can't do that in 1.48

2.how to implemnt align macro in coff format?

who can help?
Posted on 2003-07-29 22:11:53 by Hume
and yet another question:

how to get the offset relative to the current section,it seems $ is not.
Is there any thing like $ in mz format?

it's unfortuante for me if I must calculate it by hand like:

section ".code" code

start:




......
end:
x=end -start

is there any better solutions?
Posted on 2003-07-29 22:17:00 by Hume


format MS COFF

macro align value { rb (value-1) - (($-origin) + value-1) mod value }
macro public [arg] { public arg }

public main,somevar

origin equ codesec
section '.text' code readable executable
codesec:
push edi
pop esi
align 4
somevar dd ?

origin equ datasec
section '.data' data readable writeable
datasec:
nop
align 4
change dd -1



For reference..
If you want more, you can adapt the above code.
Posted on 2003-07-29 22:25:23 by Bi_Dark
thx for the macro
Posted on 2003-07-29 23:01:52 by Hume
You can simplify the above with such macro:


macro section args
{
local ..origin
origin equ ..origin
section args
..origin:
}
Posted on 2003-07-30 04:15:06 by Tomasz Grysztar
thank you, Privalov
Posted on 2003-07-31 20:26:01 by Hume
excuse me for so many stupid questions,this is yet another:

Is there anyway to determine which format the file was compiling for in the macro?this can make macro be used under diffirent target compilings...

e.g. C compiler defined __STDC__,is there any keywords or macro can achieve the same result in fasm?

If there's not one,I think maybe offer such internal macro definition useful?
Posted on 2003-07-31 20:43:45 by Hume