Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> borland turbo c / turbo c++</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Borland Turbo C / Turbo C++
------------------------------------------------------------------------------
 Blinker supports all versions of Turbo C and Turbo C++ to create DOS real
 mode programs. The following sample programs written in Turbo C or Turbo C++
 will be used throughout this section to illustrate the basics of linking
 Turbo C and Turbo C++ programs with Blinker.

 Turbo C++ requires the link script to include the start up module C0x.OBJ as
 the first FILE, optionally EMU.LIB, MATHx.LIB as LIBs, and Cx.LIB and
 optionally GRAPHICS.LIB as the last LIBs, where x is the memory model.
 Overlaid programs must be compiled to use far calls, i.e. medium, large or
 huge memory model.

 Note: The stack size of a Turbo C / Turbo C++ program must be set in the
 variable _stklen from within the program code, not by the STACK link
 command. (e.g. extern unsigned _stklen = 8192;). Please refer to the Borland
 documentation for further details.

 TEST.C
 void limerick (void);
 void main (void)
 {
    limerick ();
 }
 LIMERICK.C
 <include <stdio.h>
 void limerick (void)
 {
    printf ("There was a young fellow from Borland\n");
 }

 The two modules are compiled as large model code as follows :

 TCC -c -ml test.c
 TCC -c -ml limerick.c

 Non-overlaid program

 # TEST.LNK (This is a comment)
 FILE c0l       # Turbo C startup code
 FILE test      # The main program
 FILE limerick
 LIB cl         # Turbo C library
 OUTPUT t       # Output .EXE name
 MIXCASE        # Make link case sensitive

 This causes Blinker to link the two object modules specified in the FILE
 command (test.obj and limerick.obj) to create a program with the name T.EXE
 as specified in the OUTPUT command.

 Overlaid program

 # TESTOVL.LNK
 BLINKER OVERLAY OPSIZE 50     # 50kb overlay area
 BLINKER OVERLAY PAGEFRAME ON  # Run overlays in pageframe
 BLINKER MESSAGE WINK          # Only wink one eye
 FILE c0l                      # Turbo C startup code
 FILE test                     # This file is not overlaid
 BEGINAREA                     # Start of overlays
    FILE limerick              # This file is overlaid
 ENDAREA                       # End of overlays
 LIB cl                        # Turbo C library not overlaid
 OUTPUT t                      # Output .EXE name
 MAP A,S                       # Create MAP file
 MIXCASE                       # Make link case
 sensitive

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson