[next] [prev] [prev-tail] [tail] [up]

### 3.5 Creating an executable for GO32V1 and PMODE/DJ targets

The GO32V1 platform is officially no longer supported, so this section is of interest only to people who wish to make go32V1 binaries anyway.

#### GO32V1

When compiling under D O S, GO32V2 is the default target. However, if you use go32V1 (using the -TGO32V1 switch), the compilation process leaves you with a file which you cannot execute right away. There are 2 things you can do when compiling has finished.

The first thing is to use the D O S extender from D.J. Delorie to execute your program :

       go32 prog

This is fine for testing, but if you want to use a program regularly, it would be easier if you could just type the program name, i.e.

       prog

This can be accomplished by making a D O S executable of your compiled program.

There two ways to create a D O S executable (under D O S only):

1. if the GO32.EXE is already installed on the computers where the program should run, you must only copy a program called STUB.EXE at the begin of the AOUT file. This is accomplished with the AOUT2EXE.EXE program. which comes with the compiler:

             AOUT2EXE PROG

   and you get a D O S executable which loads the GO32.EXE automatically. the GO32.EXE executable must be in current directory or be in a directory in the PATH variable.
2. The second way to create a D O S executable is to put GO32.EXE at the beginning of the AOUT file. To do this, at the command prompt, type :

             COPY /B GO32.EXE+PROG PROG.EXE

   (assuming Free Pascal created a file called PROG, of course.) This becomes then a stand-alone executable for D O S, which doesn’t need the GO32.EXE on the machine where it should run.

#### PMODE/DJ

You can also use the PMODE/DJ extender to run your Free Pascal applications. To make an executable which works with the PMODE extender, you can simply create an GO32V2 executable (the default), and then convert it to a PMODE executable with the following two extra commands:

1. First, strip the GO32V2 header of the executable:

             EXE2COFF PROG.EXE

   (we suppose that PROG.EXE is the program generated by the compilation process.
2. Secondly, add the PMODE stub:

             COPY /B PMODSTUB.EXE+PROG PROG.EXE

   If the PMODSTUB.EXE file isn’t in your local directory, you need to supply the whole path to it.

That’s it. No additional steps are needed to create a PMODE extender executable.

Be aware, though, that the PMODE extender doesn’t support virtual memory, so if you’re short on memory, you may run unto trouble. Also, officially there is not support for the PMODE/DJ extender. It just happens that the compiler and some of the programs it generates, run under this extender too.

[next] [prev] [prev-tail] [front] [up]