mathi maaran wrote:
> hi everyone ,
>
> I am working with win32 asm programs(gui)
> i create PE executables with nasm alone (without a linker);
> i.e the -fbin option .
> i got a include file pemac.inc and it works well
[disclaimer]
The Nasm development team is not responsible for the contents of any
include files you may be using. If you discover a problem with anything
in the "misc" directory, we'll try to fix it, but there are a *lot* of
include files floating around, and they're not all "right"...
[/disclaimer]
> but when i use resb or resd nasm gives a warning about the use of these
> commands
> in the program
> i don't know whether it is a bug.
Nasm will warn if "res?" is used in a non-.bss section. "times" should
be used instead, but Nasm'll just zero it, so it does no harm. Doesn't
give you a .bss section, but it should still work.
> even though i name the code section with diff names nasm always refers
> to it as .text section.
That suggests that your intended section name is being ignored (Nasm
defaults to ".text"). "pemac.inc" redefines things all over the place,
but it looks to me like it wants "BSS" - uppercase and no dot - in order
to generate a ".bss" (case insensitive) section.
> i use 0.98.32
That could be a problem right there. Some "multisection support" was
added in 0.98.08. A bug involving "align" was found, and in the course
of fixing it, some "ill advised" (according to some) features were
found. In 0.98.36, a *completely* re-done "multisection support" was
added (much more powerful and flexible, IMO). If you stick to the
"known" section-names, ".text", ".data", and ".bss", you won't notice
any difference, but "homemade" section names behave slightly
differently. I don't know if it'll help, but I'd advise updating (to
0.98.38 - 0.98.37 is buggy as hell... mostly in the "-f elf" format,
but...).
> please clear my doubt
Well, not at first shot, I'm afraid... I'll look into it more, and I'll
cc this reply to the "nasm-users" list. NuMIT-or hangs out there, and
can probably pinpoint your problem instantly.
By coincidence, I just tried my first example using "pemac.inc" -
actually, I modified "pemac.inc", so I *know* there exist modified
versions :) There's a "bug" (IMO) in the dos stub (doesn't set ds), but
I modified it to use a "special" stub - the program in question was
NuMIT-or's "shutdown" example, and I didn't figure "this program
requires windows" was really true, just to shut down (I modified the
original program to "reboot" rather than "shutdown", too). So now it
works from dos, too! (if anyone cares...) This program doesn't have a
.bss section, so I don't have an example of how that's supposed to be
done :(
I don't think this is a Nasm bug, so further discussion should maybe go
to another list - the SourceFrog "nasm-users" list or the Yahoo
"win32-nasm-users" list would probably be most appropriate. We *may*
need you to "post the code", and/or indicate the date and file-size of
the "pemac.inc" you're using (my modification may not be the only one
out there :)
I'll cc this to the Yahoo list, too - that being the most popular one.
Please drop the nasm-bugs list from any replies - I really don't think
it's a Nasm problem...
Best,
Frank
|