BC-FORTRAN77 Vers 1.3b
copyright: Andre Koestli
1990 Martin Luther Str.63
D700 Stuttgart 50
Version "b" of BC-FORTRAN77, comprised of the 5
files described later, is programmed entirely by
me. I permit free use of version "b" for non-
commercial applications, with all rights remaining
with me, in particular the sale of version b
together with other products is not allowed. Every
copy must include this text unchanged. Use for
military purposes or corresponding research is
July 1990 A. Koestli
BC-FORTRAN77 Version b consists of a compiler, linker, module library and a
resident run-time system, which also contains a simple debugger. This version
runs on an MS-DOS computer with 640kB RAM. A hard disk is not required. A
compiler for a programming course should become available as a result of this.
Then will come the corresponding compiler for the Atari ST and Amiga.
I will still answer inquiries for sending another or newer version if 20
Deutchmarks (currency or check) to cover expenses for diskette, mailer,
postage and time is included. I only send 3 1/2" diskettes.
BC-FORTRAN77 version b consists of the following parts:
LIES.TXT This text
BCRTSY.EXE Resident run-time system
LIB.B Library of standard functions
When a copy is made all of the parts mentioned above must be included.
BEFORE the compiler, linker or program is started, the resident run-time
system MUST be loaded. For this, just run the program BCRTSY.EXE. If you use
BC-FORTRAN77 regularly, place BCRTSY.EXE in your AUTOEXEC.BAT file.
Copy the *.EXE files into a directory contained in the PATH and the LIB.B file
in an APPEND directory (see the MS-DOS commands PATH and APPEND).
The compiler is started by
BCF [-Option...] File...
If File does not contain a period, a .F will be appended. The object file
will be placed in FILE.B.
BCF -D TEST.F
Compile TEST.F with the debug option into TEST.B
BCF TEST SUB
Compile TEST.F into TEST.B and SUB.F into SUB.B
Compile TEST.X into TEST.B
You can use /Option instead of -Option.
-D Debug: equivalent to -BVL
-B deBugcode: implies -H and also produces debugger calls for
examination of field borders and substrings.
-H parcHeck: produces code for examination of parameter lists
and checks of stack overruns
-V Varlist: List of variables for debugger
-L Lineslist: Line number list for debugger
-U Uppercase: Changes lower-case into upper case characters (even
in character constants and formats). Without this
option xy, XY, Xy and xY are four different
-F Free input: Source program is not in FORTRAN format. Non-standard!
-P Protocol: registry of the compiled lines.
-S Short protocol: One line per module with the size of the stack
frame and code in bytes.
-O One: produces one output file with name of the first
BCC-FORTRAN77 compiles the complete standard from ANSI/ISO. The
language standard will, however, be violated by several peculiarities
(mostly these will be called extensions). I strongly recommend that
these extensions not be used, since they are non-standard and hence
not precisely defined.
The most important of the "peculiarities" are:
INTEGER*1 8 bit INTEGER
INTEGER*2 16 bit INTEGER
INTEGER*4 like INTEGER
LOGICAL*1 8 bit LOGICAL
LOGICAL*2 16 bit LOGICAL
LOGICAL*4 like LOGICAL
IMPLICIT NONE turns off implicit type definitions
COMMON /%adr/ Absolute COMMON, adr is a constant or simple
variable which specifies the segment address
EQUIVALENCE() allows character and other types to be mixed in COMMON
Recursive subroutine calls
Names with a maximum of 8 characters (the standard is 6).
The most important restrictions are:
32kB Code+SAVE/DATA for subroutines
32kB local data for subroutines (stack frame) 32kB for COMMON
(actually 64kB, but the address of the last field must be <32k)
700 subroutines per file 500 different COMMON blocks per file
Less important are a series of restrictions where very large
subroutines give rise to error messages without surpassing the 32kB
The Linker is started by
BCL [-Options...] File...
If File doesn't contain a period, a .B will be appended. The
executable file will be created with the name of the first file but
with .EXE substituted for .B. It must also search the LIB.B file in
order to link the standard functions and I/O routines.
BCL -S16 TEST SUB LIB
BCL -S16 TEST.B SUB.B LIB.B
links the files TEST.B and SUB.B into the runnable program TEST.EXE with a
stack size of 16kB.
-Sn Stack size will be set to n kB (max 64). Without this option
a 64kB stack will be used. All local variables and fields for
a subroutine will be placed on the stack.
-O Optimize: subroutines which are not called are omitted.
-P Protocol: List the COMMON blocks and program modules
The most important restriction lies in the size of RAM: the size of
the program (without COMMON and stack) can only be as large as the
largest free memory block after loading BCL. On the other hand, it is
possible to produce a program with large COMMONs and stack which will
not run in the available memory.
The number of subroutines is limited to 3000, the number of COMMON
blocks to 1500. (This is a result of the ridiculous 640kB limit of
Run Time System
The run time system BCRTSY.EXE contains the routines needed by a
FORTRAN77 program and must be made memory resident before any
FORTRAN77 programs are run.
32 bit INTEGER multiplication & division
DOUBLE precision arithmetic
It uses the IEEE floating point format
REAL: 7 decimal places, 32 bit 1 bit sign, 8 bit exponent, 24
DOUBLE PRECISION: 14 decimal places, 64 bit 1 bit sign, 11 bit
exponent, 52 bit mantissa
A math coprocessor is not supported. (an 80x87 version exists,
but I can't test it since I don't have the necessary
A simple debugger for finding errors.
Also a run time error will give an error message and wait for a
The debugger can also be activated by a key-stroke interrupting
the program's execution if the program was created with the B
option. The following keys are recognized by the debugger as
T (Traceback) Look back through the subroutine call stack and
find the next higher module with line number if the program
was compiled with the -L option.
U (Untrace) Cancel all trace back actions. This happens
automatically when the program is restarted.
V Display Variables of the current subroutine with their
current contents if the program was compiled with the -V
option. Move into the last displayed program module when T
Z Terminate program. Resume program execution, unless there was a run-time error
S Step program until next label, subprogram ELSE, ENDIF or DO.
C step subroutine until next CALL or RETURN
LIB.B contains the full set of mathematical functions prescribed by the
standard. If you get an error message when linking e.g.
External nicht gefunden: f_SQRT
then you should place LIB.B on the BCL command line.
Running a Program
Once a program has been linked with BCL it can be run like any other program,
either from the desktop or from a shell.
The error messages from the compiler, linker and run time system should be
self-descriptive except for the following exceptions. The complete listing is
outside the scope of this description (it takes 26 pages in the handbook of
Input/output errors may be intercepted by placing the IOSTAT= parameter in the
IO statement. The number has the same value as is returned in the IOSTAT
-1 End of File
-2 End of File in middle of record.
1 File number already in use (OPEN)
2 Too many files (OPEN). Max. is 32
3 File name too long (OPEN). Max is 32 characters.
5 File number not opened. Only file numbers 5 and 6 can be
used with being OPENed
6 formatted/unformatted contradiction
7 REC parameter for file with ACCESS='SEQUENTIAL'
8 BACKSPACE, REWIND, ENDFILE are not possible for files AUX: and PRN:
10 Internal I/O is formatted only
20 INTEGER overflow
21 Data error by the listing generator input, e.g. missing
apostrophe for a symbol link
22 unexpected end of data
23 record too long
24 UNFORMATTED SEQUENTIAL read error
30 IO list element doesn't match format element.
INTEGER needs I format
REAL, DOUBLE PRECISION (COMPLEX) need one or two F, G, E or
D format elements
31 Format element L: T or F expected (input)
32 format element I: unexpected characters (input). Null
characters, signs and numerics allowed.
33 format element E, F or D unexpected characters (input
null characters, signs, numerics, decimal point, E, e, D or
d (for the exponent) allowed.
34 too many ( in format
35 too many ) in format
36 numeric character in a disallowed place in format
37 illegal format element
38 decimal point error in F, E, G, or D format element
39 4Htext or 'text' in format for READ. In FORTRAN66 this was
allowed as a way to read in text but in FORTRAN77 this is
no longer allowed.
40 exponent too large for the given format.
42 format element too long. Must be less than the internal
record buffer size (80 characters).
43 Internal I/O, record too long.
44 TL, record too long.
45 zero field length in I, L, F, E, G, D format
1000+n MS-DOS Error n
1002 File not found
1003 Path not found
1004 Too many open files
1005 Access denied
1008 Not enough free RAM
1012 Invalid access code
1015 Invalid disk drive
The 80x87 version has not been tested and can not be supported.
Write to me if you find any other kind of errors .
This is one time I am happy to see terse documentation. Boy, is my German
If any real German speakers have improvements to this translation, especially
the computer terms (like Ausgabe, Zugriff or Zeichenketten), please
contact me at the following address and I will incorporate them.
Here are some usage hints based on my limited experience with this package:
- always specify LIB when linking, you'll need it and the linker may crash
and burn without it.
- I compiled a file with mixed upper and lower case variable names and that
too crashed the linker. Compiling with -u worked just fine.
Here are some translations of compiler error messages I've encountered.
Doubtless there are many more but you should be able to figure them out.
200 Unrecognized statement
201 Declaration not allowed here
203 Multiply defined label
252 Illegal expression
253 Equals sign expected
282 Undefined label
The format of the compiler error messages is the error number followed by the
error description (in German). On the next line is the string which was being
scanned when the error was encountered, followed by the line number where the
error was noticed.
Have fun! --WVL]