From: "John S. Fine" Newsgroups: comp.os.msdos.djgpp Subject: Re: Generating Machine Code on the fly Date: Sat, 27 Feb 1999 16:56:01 -0500 Lines: 34 Message-ID: <36D869F1.461F@erols.com> References: <7b6qpv$39t$1 AT news8 DOT svr DOT pol DOT co DOT uk> <199902261912 DOT OAA24117 AT envy DOT delorie DOT com> <7b7gra$5nh$1 AT news4 DOT svr DOT pol DOT co DOT uk> <199902270142 DOT UAA26915 AT envy DOT delorie DOT com> <7b80qg$qm3$1 AT news8 DOT svr DOT pol DOT co DOT uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: PaBkfppeFop2QYpLxeybJ6X6uvmcnHmGVJzE7oFNoUA= X-Complaints-To: abuse AT rcn DOT com NNTP-Posting-Date: 27 Feb 1999 21:57:21 GMT X-Mailer: Mozilla 3.01 (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew Davidson wrote: > DJ Delorie wrote ... > >In djgpp? No. It's already taken care of for you. > > I don't know if I'm following this but if I'm just pointing the program > counter at a bunch of bytes djgpp should have nothing whatsoever to do with > memory mapping. If I'm using the cpu at the lowest possible level (straight > machine code) doesn't that mean I'm limited to 64k chunks of memory that I > can write machine code into? A 386+ CPU can be executing either 16-bit code or 32-bit code. The machine languages for the two are very closely related, but not identical (no flames please; I'm trying to make this simple). DJ was clearly assuming you intend to generate 32-bit machine code, in which case there is no 64K limit. If you intended to generate 16-bit machine code, then calling it from a djgpp C program will be a little more complicated, and there are a variety of limits. If you have a choice in the design, you should generate 32-bit code. It will make many things simpler. Even when executing raw machine code, the paging and protection systems of the CPU will still be active. If your code exceeds the size of physical memory, you can simply ignore that fact and some component of the system (Windows or CWSDPMI or whatever) will provide virtual memory. My point is that "memory mapping" is still provided even though you are running raw machine code. -- http://www.erols.com/johnfine/ http://www.geocities.com/SiliconValley/Peaks/8600/