Mail Archives: djgpp/1999/02/27/17:11:20
Andrew Davidson wrote:
> DJ Delorie <dj AT delorie DOT com> 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/
- Raw text -