Re: [Clax86list] Disassembler questions



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.

--
Chuck
http://www.pacificsites.com/~ccrayne/charles.html

.



Relevant Pages

  • Re: questions from a newbie
    ... Nobody has given me reasons to use as, nasm, or others and why. ... O_DIRECTORY equ 00200000Q ... mov ebx,texmfdir ... int 80h ...
    (alt.lang.asm)
  • Re: c and assembler program, help me please!
    ... i'm using linux with gcc-4.1 and nasm 0.98.38: ... global _espera ... This "int 0x16" feels like a DOS-style interrupt. ... Linux system calls instead. ...
    (comp.lang.c)
  • Re: Why this toy code wont execute on Intel Linux platform??
    ... > and making an executable with gcc after NASM makes a .o file. ... Or you could use Linux int 80h... ... mov ebx, 1; STDOUT ...
    (comp.lang.asm.x86)
  • Re: gcc as a linker....
    ... >I'm assuming that the code below is hello.asm and you've assembled with NASM ... mov dx, msg; segment portion of pointer to string ... int 0x21; interrupt 21 hex, ...
    (comp.os.msdos.djgpp)
  • Re: c and assembler program, help me please!
    ... i'm using linux with gcc-4.1 and nasm 0.98.38: ... This "int 0x16" feels like a DOS-style interrupt. ... Linux system calls instead. ... it show me this error: Segmentation fault in both windows ...
    (comp.lang.c)