From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: HELP!... execute CODE in DATA segment seems not work Date: Tue, 01 Sep 1998 18:22:43 -0300 Organization: NBTel Internet Lines: 19 Message-ID: <35EC65A3.78892F9C@unb.ca> References: NNTP-Posting-Host: fctnts13c33.nbnet.nb.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Eli Zaretskii wrote: > When you press Ctrl-C (which is supposed to generate the SIGINT > signal), that keypress is caught by the keyboard handler installed by > the DJGPP startup code. The handler processes Ctrl-C by making the DS > limit be 4K. Since all data in your program lives above the first 4K > (that's how things are set up at startup), the first time your program > touches any of its data, a CPU exception is generated, because > protected mode doesn't allow accesses to data beyond the DS limit. > This exception is caught by the DJGPP exception handler, which sees > that the exception was generated on behalf of a Ctrl-C, restores the > DS limit to its normal value, then calls "raise(SIGINT);". That was a neat idea. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca