Things you'll need:
*Visual C++ (I used version 2.0 & 4.0. I don't know about 6.0 and
beyond.)
*Some kind of MS-DOS 16 bit real mode compiler... http://edn.embarcadero.com/article/21751
or http://openwatcom.org/index.php/Main_Page
*HX DOS extender http://www.japheth.de/HX.html
Visual C++ 2.0 & beyond no longer use link32.exe but it's simple
enough to build a MS-DOS program that will call link.exe. It works
better this way fwiw.
------8<------8<------8<------8< link32.c ------8<------8<------8<
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void main(int argc,char* argv[])
{
char command[255];
int rc;
int j;
memset(command,0x0,sizeof(command));
sprintf(command,"link ");
j=1;
while(j<argc)
{
sprintf(command,"%s %s",command,argv[j]);
j++;
}
printf("running [%s]\n",command);
rc=system(command);
printf("return code was %d\n",rc);
if(rc==-1)
{printf("I think it's too many nested DPMI things between TNT
& whatnot\n");}
}
------8<------8<------8<------8<------8<------8<------8<------8<
Ok, it’s not work of art, but it’ll get the job done. You’ll need to
compile this with some kind of MS-DOS 16 bit real mode compiler.
I would imagine Watcom’s C++ compiler can still build 16bit dos
realmode exe’s, or Borland has something in their museum thing. I’m
using QuickC for Windows in a Windows 3.0 VM…
Ok so now with our ‘link32.exe’ replacement, copy it into the f32\bin
directory overwriting the existing one.
Next we will need the link.exe from Visual C++ 2.0 (or higher I
figure), and copy that into the f32\bin directory, along with it’s
needed files dbi.dll & msvcrt20.dll.
Next, download and unzip the HX runtime And you can either place it’s
bin directory onto the fl32\bin, or unzip it to it’s own directory,
and add a statement in your autoexec.bat adding it’s bin directory to
the path.
Reboot to pickup the hxrt’s bin directory, unless you copied it’s bin
into fl32\bin
Now we need to alter Visual C++ 2.0’s linker to run under MS-DOS.
Simply run
pestub \f32\bin\link.exe
And now you should be able to run link.exe under MS-DOS.
Finally replace the libc.lib & kernel32.lib with ones from your Visual
C++. Naturally these are in the \f32\lib directory. Visual C++ 2.0
will link without complaining, 4.0 gives some weird messages, but it
still works. I never did test Visual C++ 6.0 & beyond.
So building a simple ‘hello.for’
-------8<-------8<-------8< Hello .for ---8<-------8<-------8<
program hello
print *, 'Hello!'
end
-------8<-------8<-------8<-------8<-------8<-------8<-------8<
c:\F32>fl32 hello.for
Microsoft (R) FORTRAN PowerStation Optimizing Compiler Version 1.0
Copyright (c) Microsoft Corp 1984-1993. All rights reserved.
hello.for
Microsoft (R) 32-Bit Incremental Linker Version 2.50
Copyright (C) Microsoft Corp 1992-94. All rights reserved.
-out:hello.exe
-debug:none
-machine:i386
-base:0x00010000
-subsystem:console
-entry:mainCRTStartup
-stack:32768,4096
-defaultlib:libf.lib,libc.lib,kernel32.lib,ntdll.lib
hello.obj
running [link -link @C:\TEMP\003635lk]
return code was 0
The only caveat here, is that because of HXDOS it *thinks* it’s
running on Windows NT, (beta 2!) and will not run the bindmsf.exe
program… Not that it mattered as it was broken. I suppose if I were
more brave I could read the link file, and scan for a ‘-out’ and run
pestub on the output.. But I don’t so you will have to. Otherwise
when you run hello.exe you’ll get:
This program cannot be run in DOS mode.
But running pestub.exe: (***)
c:\F32>pestub hello.exe
pestub: hello.exe modified successfully
C:\F32>hello
HELLO!
Ok, so with all this work, we’ve managed to restore the basic
functionality of Microsoft Fortran here. Now the bigger question,
will hello.exe run on say Windows Vista x64?
C:\Users\neozeed\dos\F32>ver
Microsoft Windows [Version 6.0.6002]
C:\Users\neozeed\dos\F32>hello
HELLO!
***Under DOSBox the pestub may fail for various reasons, but DOSBox
provides a great way to compile in one window, then to execute in
another... Does it matter if it's not able to run in MS-DOS since you
found this post by looking for a way to get around the
RtlExAllocateHeap thing?
Sadly unless there is a good way to decompile the compiler, and re-
link it, it will not run under Windows NT, 2000 or Vista natively as
it was built with the same defective linker that it shipped with...
Beyone hello.for I've also built dungeon (
http://ifarchive.plover.net/if-archive/games/source/dungeon-2.5.6.tar.gz
) which is described as:
"FORTRAN source code of Dungeon, the more or less public domain
version of the original MIT Zork, version 2.5A, 30-Aug-90. This
version is Robert M. Supnik's DECUS version 2.5A (18-Jul-80), ported
to Linux with f2c. "
At first I was writing about f2c, then I found some powerstation disks
and I wanted to see if I could somehow get this running... And it
runs on my Windows 7 rc1 x64 machine...
I'm compiling with DOSBox 0.72 and I'm using the linker from Visual C+
+ 2.0, along with it's libc.lib/kernel32.lib
------8<------8<------8<------8<------8<------8<------8<------8<
C:\Users\Neozeed\dos\F32\DUNGEON>ver
Microsoft Windows [Version 6.1.7100]
C:\Users\Neozeed\dos\F32\DUNGEON>DUNGEON.exe
Welcome to Dungeon. This version created 30-AUG-90.
You are in an open field west of a big white house with a boarded
front door.
There is a small mailbox here.
>history
Revision history:
30-AUG-90 Portable non-DEC version
18-JUL-80 Transportable data base file (V2.5A).
28-FEB-80 Compressed text file (V2.4A).
15-NOV-79 Bug fixes (V2.3A).
18-JAN-79 Revised DECUS version (V2.2A).
10-OCT-78 Puzzle Room (V2.1A).
10-SEP-78 Endgame (V2.0A).
10-AUG-78 DECUS version (V1.1B).
14-JUN-78 Public version with parser (V1.1A).
4-MAR-78 Debugging version (V1.0A).
>quit
Your score is 0 [total of 585 points], in 2 moves.
This gives you the rank of Beginner.
Do you wish to leave the game?
y
Stop - Program terminated.
------8<------8<------8<------8<------8<------8<------8<------8<
"Jason Stevens" <neo...@gmail.com> wrote in message
news:aac7a200-f71f-4576...@b15g2000yqd.googlegroups.com...