Steve writes:
>
> Dan Hollis <[log in to unmask]> wrote:
>
> >Is it possible to use mapped files in CM mode? HPFOpen is NM callable only,
> >but if someone were to write a switch for it, would the pointer work in CM
> mode?
> >
>
> No. Mapped files are either short-mapped, which means that they are
> accessible with a 32-bit short pointer, or long-mapped, which means
> that they can only be accessed with a 64-bit long pointer. CM code
> only knows about 16-bit, DB or Q relative, byte or word pointers;
...
> Incidentally, there is an intrinsic that you can call to get the file
> pointer, even if the file had been opened with FOPEN, but I seem to
> remember some nasty problems if you use the file "mapped" without the
There are some undocumented CM instructions you can use, via the
SPL ASSEMBLE () statement, which gives you access to moving data to/from
virtual memory from/to your stack ..
but...
they require that you run in Priv Mode. Further, as Steve alludes to,
there are some bugs in MPE where if you FOPEN a file (or HPFOPEN without
asking for mapped access), and then get the file's virtual address via
FFILEINFO, and modify data in the file via that address (from CM or NM),
and then close the file ... the data may not ever get written to disk.
(A field called "MAP_OUT_MUST_POST" isn't set, and it should have been
set by the action of calling FFILEINFO (item 64).)
But, the short answer is: NO, you should use NM code. :)
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|