From: "Andrew Davidson" Newsgroups: comp.os.msdos.djgpp Subject: Generating Machine Code on the fly Date: Thu, 25 Feb 1999 12:39:14 -0000 Organization: Customer of Planet Online Lines: 15 Message-ID: <7b6qpv$39t$1@news8.svr.pol.co.uk> NNTP-Posting-Host: modem-108.thirsty.dialup.pol.co.uk X-Trace: news8.svr.pol.co.uk 920055423 3389 62.136.120.236 (26 Feb 1999 18:57:03 GMT) NNTP-Posting-Date: 26 Feb 1999 18:57:03 GMT X-Complaints-To: abuse AT theplanet DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.0810.800 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Is it possible to allocate an area of memory in djgpp using malloc, fill it full of bytes of machine code, and then, using an asm statement, push all the registers, call the area of memory as a subroutine, pop all the registers when that subroutine returns, and continue running the C program without any damage being done? I assume that there would be some kind of limitation on the quantity of machine code that could be run in this way? I'm not sure I explained that very well but any help on the possiblity of doing such a thing would be most gratefully recieved. Andrew