www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/11/23:34:57

Mime-Version: 1.0
To: Paulo Eduardo Ostermann Filho <peof AT cpovo DOT net>, djgpp AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: Null-Pointer and Assembly
Date: Mon, 11 May 1998 20:28:56 -0700
Message-ID: <19980512032838.AAH16211@ppp127.cartsys.com>

At 03:11  5/11/1998 +0100, Paulo Eduardo Ostermann Filho wrote:
>Hi!
>
>How do you discover a null-pointer assignment in DJGPP?

If you are using DOS and CWSDPMI (or another *good* DPMI server, you will
know because you will get a message something like this:

Exiting due to signal SIGSEGV
General Protection Fault at eip=00001620
eax=0000000a ebx=0004e1a0 ecx=00000000 edx=0000000a esi=00000054 edi=0000c0dc
ebp=0004c0a8 esp=0004c0a4 program=C:\DJGPP\HOME\A.EXE
cs: sel=00a7  base=80d2e000  limit=0005ffff
ds: sel=00af  base=80d2e000  limit=0005ffff
es: sel=00af  base=80d2e000  limit=0005ffff
fs: sel=0087  base=000100c0  limit=0000ffff
gs: sel=00bf  base=00000000  limit=ffffffff
ss: sel=00af  base=80d2e000  limit=0005ffff

Call frame traceback EIPs:
  0x00001620
  0x00001c06

If you are using Windows, you will never know, since Windows (and it can
only be by intention, since Micro$oft helped write the DPMI spec) does not
provide the necessary facilities to detect null pointer dereferences. Thank
you, Mr. Gates. :(

>How do you work with Assembly in DJGPP?

See Section 18.3 of the DJGPP FAQ
(ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq210b.zip) for info about
the inline assembly facilities. Alternatively, you can write entire modules
with GNU as (AT&T syntax, like the inline assembly) or NASM (Intel syntax).

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019