delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/26/14:02:22

From: "Andrew Davidson" <andrew AT lemure DOT freeserve DOT co DOT uk>
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


- Raw text -


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