Date: Thu, 13 Jan 2000 17:42:30 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Stromberg cc: djgpp AT delorie DOT com Subject: Re: Problems with protected_mode_int In-Reply-To: <85junr$31i$1@antares.lu.erisoft.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 13 Jan 2000, Martin Stromberg wrote: > asm(" > my_handler: > ... > > my_handler_end: > "); > > int main() > { > unsigned char code[1000]; > > memcpy(code, &my_handler, my_handler_end - my_handler); This will most probably crash, for several good reasons: - stack is allocated off the DS selector whose access rights forbid executing any address accessed via that selector; - the only segment register that is guaranteed to be loaded with the application's selector is CS, so you cannot trust SS.