🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1804

Re: Virtual Memory for the Heap

#1804
From: Walter Bright
Date: Mon, 06 Aug 1990 18:50
38 lines
1913 bytes
In article <2699@mindlink.UUCP> a35@mindlink.UUCP (Bruce Atherton) writes:
<I agree that explicit calls for dereferencing is no way to implement
<virtual memory.  Zortech seems to use the most elegant solution I've
<heard about so far.
<Can you use a _handle anywhere you would use a pointer?

Anywhere you would use a far pointer, except if you want a far pointer
that points into the BIOS.

<Can you declare a _handle to a _handle to a function that returns a _handle?

You cannot have _handle pointers to functions (there is no point to that!).
But you can do things like:

	char _handle *(_handle **)(void);

which is a _handle to a pointer to a function returning a _handle.

<Does this have to be a part of the compiler, or could I write an object
<in any C++ that would do the same thing?

You can do it in standard C++ on a class-by-class basis by overloading the
* [] and -> operators. The disadvantage is that the optimizer cannot tell
when the dereferencing function calls are redundant and cannot eliminate
them. For instance:
	struct A __handle *h;
	h->a = 1;
	h->b = 2;
On the second assignment, the function call to dereference h can be
eliminated if handles are built in to the compiler, but cannot be if
it's a user-defined function in C++.

You cannot do it with pointers to something-besides-a-class in standard C++.

<Finally, can you create a pointer into the ROM BIOS area?

Yes. Simply use a far pointer:
	char far *p = MK_FP(0xFFFF,0);
Technical Details
Message-ID: <2618@dataio.Data-IO.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!uw-beaver!sumax!nwnexus!pilchuck!dataio!bright
References: <2699@mindlink.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!uw-beaver!sumax!nwnexus!pilchuck!dataio!bright
From: bright@Data-IO.COM (Walter Bright)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Virtual Memory for the Heap
Message-ID: <2618@dataio.Data-IO.COM>
Date: 6 Aug 90 18:50:34 GMT
References: <2699@mindlink.UUCP>
Organization: Data I/O Corporation; Redmond, WA
Lines: 38