Am 08.11.2017 um 18:47 schrieb Thomas David Rivers:
Frank Swarbrick wrote:

Doesn't that make for fairly large executables?



Well - it can - but a trimmed down C library is surprisingly small.

Of course - if you're dragging C++ into this, then things get bigger; but
again - that's not the library usually, it's the templates, etc.. that your
program instantiates...

It seems, in practice, to not be an issue at all.

 - Dave Rivers -


Just to give an example, how small a runtime library can be:

my New Stanford Pascal compiler has a runtime library, which is also linked with every Pascal program (in the same way as Dave describes). The Pascal compiler itself is a Pascal program (ca. 15.000 lines at the moment - pass one, generating P-Code; the P-Code is later translated to 370 machine code, which is done in pass two, which has another 12000 lines). For the following discussion, PASCAL1 (pass one) only serves as
an example of a (large) Pascal program.

Pass one has, after compilation, the following size:

 ENTRY ADDRESS    1E940
 TOTAL LENGTH     30AC8
****PASCAL1   NOW REPLACED IN DATA SET
AUTHORIZATION CODE IS         0.

the size of PASCAL1 is 200 k, ca.

Excerpts from the Linker listing:

  CONTROL SECTION                       ENTRY
    NAME    ORIGIN  LENGTH                NAME   LOCATION NAME   LOCATION
  $PASMAI#      00     E28
  $PRV0001     E28      AC
  $PRV0002     ED8      C8
  $PRV0003     FA0      E8
  $PRV0004    1088      78

The runtime starts here:

  $PASENT    1E940    53E0
                                        $PASINT    1EE88 $PASTRC    1F0CC
                                        IHNERRM    1FB36 ERRMON     1FB36
                                        IHCERRE    1FB6A $PASSYS    1FB78
                                        $PASCSP2   2005A
  $PASLIB#   23D20      2C
  $LIBX002   23D50      BC
  $LIBX004   23E10     118

that is:

the "core" runtime, written in ASSEMBLER, is $PASENT,
and its size is 21 k (!).

The "library" functions from $PASLIB (written in Pascal)
are added for convenience, although only very few of them
are really used in the compiler.

All those "library" function are located in the area from 23D20 to
30AC8 and need 52 k ca.

BTW: I just discovered that I added an unneeded member called PASUTILS,
which could be eliminated, so 8 k could by saved :-)

  $PASUTI#   2E938      4A
  $UTIL003   2E988      C0
  HALT       2EA48      A4
  DATETIME   2EAF0     184
  DATTIM10   2EC78     1C4
  TERMIN     2EE40     290
  TERMOUT    2F0D0     290
  ASSIGN     2F360     320
  ASSIGNME   2F680     1A4
  CLRSCRN    2F828     1B8
  MOVEPARM   2F9E0     178
  TOUPPER    2FB58     104
  TOUPPERS   2FC60     10C
  $UTIL016   2FD70     118
  $UTIL017   2FE88     33C
  DUMPSTOR   301C8     138
  INTTOSTR   30300     284
  IVALSTR    30588     3F8
  READSYMB   30980     144

if you are interested in the compiler, look here:

http://bernd-oppolzer.de/job9.htm

or here:

https://www.facebook.com/StanfordPascal/?ref=aymt_homepage_panel

the compiler runs on old CMS and MVS versions, but on modern z/OS, too (limited to AMODE 24, at the moment), and probably on z/VM (not tested yet). You can download the compiler
using the links above.

Kind regards

Bernd

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to