Compiling and Linking 16 bit ADCs

The following sections describe how to build an ADC on 16 bit Intel platforms. (MS-DOS, FlexOS, OS/2, Windows 3.x)

Linker option files are supplied which reference all the ADC modules except the user-defined module ( auxuser, auxdebug, auxdupe etc). These option files are named AUXn.LNK or AUXn.INP , where n relates to the operating system as per the above table. These option files are referenced by the AUXLINK batch files during linking. AUXLINK files are supplied for each environment supported for the ADC and are convenient tools for linking. It is important to use the correct parameters with AUXLINK, especially when the executable will later be converted for another operating system - run AUXLINK -HELP for advice.

The example link commands given in the following sections are for the example ADC AUXDEBUG . To build a different ADC replace " AUXDEBUG " with the name of your user-defined (auxuser-derived) module in the link command, or supply that name as a parameter to the appropriate AUXLINK file.

Compiler Support

ADCs can be built using any memory model supported by DP4 program libraries: small,medium, and large for Microsoft C; and the same models plus Big model for Metaware C. Microsoft C should be used for OS/2 and Windows ADCs. Metaware C should be used for FlexOS. MS-DOS ADCs can be built with either compier. ADC modules should be compiled with the same compiler options as normal DP4 programs, except that for 16 bit Windows programs you will also want to specify the options normally used for Windows programs if you are calling Windows functions directly. A batch file called auxlink.bat is supplied for each memory model, and can be used to link ADCs for any platform by specifying the ADC number for the target platform i.e.:

NrPlatform
2MS-DOS
5FlexOS
7OS/2
wWindows

The target ADC will default to the one appropriate to host operating system if not specified. When used with the /C option the small model version of AUXLINK can build an MS-DOS ADC program that can be converted to another operating system. It is vital to specify the correct platform in this case. Although theoretically possible It is highly inadvisable to attempt to build a Unix ADC using 16 bit compilation. Such ADCs will nor work beyond release 4.520 and will only work on platforms with the I286emul program.

You are strongly recommended to use or adapt the AUXLINK file. If for some reason this is inconvenient the following information may be helpful.

MS-DOS Development

Microsoft C

Memory models supported: Small, Medium, Large

Compiling

Compile all the source files (listed above):

Small Model:
cl -c -AS -FPa -Osi -Zelp filename.c
Medium Model:
cl -c -AM -FPa -Osi -Zelp filename.c
Large Model:
cl -c -AL -FPa -Osi -Gt16 -Zelp filename.c

Alternatively use the compiler batch file, MC.BAT, supplied by DP4 for each model.

Linking

Link using the Microsoft linker.

Small Model:
link /noe @aux2.lnk auxdebug, auxdebug, con, mcowns slibca
Medium Model:
link /se:256 /st:4096 /noe @aux2.lnk auxdebug, auxdebug, con, mcownm mlibca
Large Model:
link /se:256 /st:6144 /noe @aux2.lnk auxdebug, auxdebug, con, mcownl llibca

Alternatively use the AUXLINK.BAT file supplied by DP4 for use with the relevant Microsoft compiler memory model.

Metaware High C

Memory models supported: Small, Medium, Big, Large

Compiling

Compile all the modules using the hc compiler.

WARNING: It is vital that the HC.PRO files supplied by DP4 for your chosen Metaware compiler model(s) are referenced appropriately during Metaware compilation

Linking

Link using the Microsoft linker:

Small Model:
link /se:256 hcroot2 @aux2.lnk auxdebug, auxdebug, con, hcowns hcse
Medium Model:
link /se:256 /noe @aux2.lnk auxdebug, auxdebug, con, hcownm hcme
Big Model:
link /noe /se:256 init dosalloc @aux2.lnk auxdebug, auxdebug, con, hcownb hcbe

( dosalloc.obj will be supplied with your compiler and a modified init.obj supplied by DP4)

Large Model:
link /noe /se:256 init dosalloc @aux2.lnk auxdebug, auxdebug, con, hcownl hcle

( dosalloc.obj will be supplied with your compiler and a modified init.obj supplied by DP4.)

Alternatively use the AUXLINK.BAT file supplied by DP4 for use with the relevant Metaware compiler memory model.

FlexOS Development

The following source files comprise the FlexOS ADC:

aux5.c
auxproc.c
auxcall.c
auxcall5.c

user-defined module (for example, your adapted auxuser.c )

All FlexOS ADCs may be built native under FlexOS, or converted from MS-DOS.

Metaware High C

Memory models supported: Small, Medium, Big, Large

Compiling

Compile all the relevant source files using hc .

WARNING: It is vital that the HC.PRO files supplied by DP4 for the various Metaware compiler models are referenced appropriately during Metaware compilation

Linking

Link native under FlexOS using the Metaware linker:

Small Model:

link y=hcroot5,aux5[in],auxdebug,hcowns.l86[s],hcse.l86[s]

Medium Model:
link y=aux5[in],auxdebug,hcownm.l86[s],hcme.l86[s]
Big Model:
link y=aux5[inp],auxdebug,hcownb.l86[s],hcbe.l86[s] [DA[g[DGROUP],c[DATA],c[FAR_DATA]],st[m[180]]]
Large Model:
link y=aux5[inp],auxdebug,hcownl.l86[s],hcle.l86[s] [DA[c[DATA],c[FAR_DATA]],st[m[180]]]

Alternatively use the AUXLINK.BAT file supplied by DP4 for use with the Metaware compiler and relevant memory model.

OS/2 Development

The following source files comprise the OS/2 ADC:

aux7.c
auxproc.c
auxcall.c
auxcall7.c

user-defined module (for example, your adapted auxuser.c )

Microsoft C

Memory models supported: Small, Medium, Large

Compiling

Compile all the source files (listed above):

Small Model:
cl -c -AS -FPa -Osi -Zelp filename.c
Medium Model:
cl -c -AM -FPa -Osi -Zelp filename.c
Large Model:
cl -c -AL -FPa -Osi -Gt16 -Zelp filename.c

Alternatively use the compiler batch file ( MC.BAT ) supplied by DP4 for the each Microsoft model.

Linking

Small Model:
link /noe mcos2if @aux7.lnk auxdebug, auxdebug, con, mcowns slibcap
Medium Model:
link /se:256 /st:4096 /noe mcos2if @aux7.lnk auxdebug, auxdebug, con, mcownm mlibcap
Large Model:
link /se:256 /st:6144 /noe mcos2if @aux7.lnk auxdebug, auxdebug, con, mcownl llibcap

Alternatively use the AUXLINK.BAT file supplied by DP4 for use with the relevant Microsoft compiler memory model.