Re: [Clax86list] Disassembler questions




"Charles Crayne" <spamtrap@xxxxxxxxxx> wrote in message
news:20080726135830.39e8d8d6@xxxxxxxxxxxxxxxxxx
On Sat, 26 Jul 2008 12:58:07 -0700
"Benjamin David Lunt" <spamtrap@xxxxxxxxxx> wrote:

The code looks like Linux, but the int 21h looks like DOS.
I haven't done any Linux programming, so I may be wrong here,
but shouldn't the int 21h be int 80h?

Indeed it should.

Most likely, nasm is adding padding to the end of the section. I
don't know much about nasm, but this would be my guess

NASM itself adds an ELF header before the user code, and a lot of
system information following it, but it does not pad out the section(s).
However, if one is disassembling the executable module, then one must
also consider what the linker has done.

Thanks Chuck,

I knew that. I have been working too much with binary only
assembly modules. I haven't used a linker with my assembly
in years. :-)

Thanks,
Ben

.



Relevant Pages

  • Re: How a linker works (continued)
    ... implement software that handles a particular object format. ... The linker opens all object files that it receives, ... not in the common section. ... is seen by the end of the translation unit, it is treated as ``int ...
    (comp.lang.c)
  • Re: Newbie Linking Error
    ... The error is indeed during the linking, the linker tries to find your ... > before the `int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, ... do with C++ it teaches you how to use some OS libraries (namely Win32 ...
    (comp.lang.cpp)
  • Re: TLS, Thread Local Storage..
    ... linker etc that are going to be the problems.. ... extern __thread int e; ... The BIG question is "who knows enough about the dynamic linker to be ...
    (freebsd-current)
  • Re: C++ Project Files?????
    ... write "int Hello", I always write "int Hello", I also always include ... Mr Linker won't even hear about these functions! ... So just how much of all this is in the C++ Standard? ... So I think to myself: "Is my program starting at "WinMain", or is it starting at "main", and is "main" just hidden away in some object/library file and looks like this: int main{//blah blah blah ...
    (comp.lang.cpp)
  • Re: Linker cannot find WinMain() in object
    ... > _WinMain@16 referenced in function _WinMainCRTStartup" ... > and the linker options have /entry:WinMainCRTStartup set so things ... HINSTANCE hInstance, ... int nShowCmd ...
    (microsoft.public.windowsce.app.development)