Pristine Ack-5.5
[Ack-5.5.git] / doc / pascal / rtl.doc
1 .sp 1.5i
2 .ft B
3 Appendix B: Changes to the run time library
4 .ft R
5 .nh
6 .sp
7 Some minor changes in the run time library have been made concerning the
8 external files (i.e. program arguments). The old compiler reserved
9 space for the file structures of the external files in one \fBhol\fR block.
10 In the new compiler, every file structure is placed in a separate \fBbss\fR
11 block. This implies that the arguments with which \fI_ini\fR is called are
12 slightly different. The second argument was the base of the \fBhol\fR block
13 to relocate the buffer addresses, it is changed into an integer denoting the
14 size of the array passed as third argument. The third argument was a pointer
15 to an array of integers containing the description of external files, this
16 argument is changed into a pointer to an array of pointers to file structures.
17
18 The differences in the generated EM code for an arbitrary Pascal program are
19 listed below (only the relevant parts are shown):
20 .in +5m
21 .nf
22 \fBprogram\fR external_files(output,f);
23 \fBvar\fR
24         f : \fBfile of \fIsome-type\fR;
25    .
26    .
27 \fBend\fR.
28 .in -5m
29
30 EM code generated by Pascal-VU:
31 .in +5m
32    .
33    .
34  hol 1088,-2147483648,0    ; space belonging to file structures of the program arguments
35    .
36    .
37    .
38 \&.2
39  con 3, -1, 544, 0         \h'80u'; description of external files
40  lxl 0
41  lae .2
42  lae 0                     \h'146u'; base of hol block, to relocate buffer addresses
43  lxa 0
44  cal $_ini
45  asp 16
46    .
47    .
48 .in -5m
49
50 EM code generated by our compiler:
51 .in +5m
52    .
53    .
54 f
55  bss 540,0,0               \h'100u'; space belonging to file structure of program argument f
56 output
57  bss 540,0,0               \h'100u'; space belonging to file structure of standard output
58    .
59    .
60    .
61 \&.2
62  con 0U4, output, f        \h'50u'; the absence of standard input is denoted by a null pointer
63  lxl 0
64  lae .2
65  loc 3                     \h'144u'; denotes the size of the array of pointers to file structures
66  lxa 0
67  cal $_ini
68  asp 16
69    .
70    .
71 .in -5m
72
73 .po
74 The following files in the run time library have been changed:
75 .in +1m
76 pc_file.h
77 hlt.c
78 ini.c
79 opn.c
80 pentry.c
81 pexit.c
82 .in -1m
83 .fi
84 .bp
85 .po