85 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			85 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
.sp 1.5i
 | 
						|
.ft B
 | 
						|
Appendix B: Changes to the run time library
 | 
						|
.ft R
 | 
						|
.nh
 | 
						|
.sp
 | 
						|
Some minor changes in the run time library have been made concerning the
 | 
						|
external files (i.e. program arguments). The old compiler reserved
 | 
						|
space for the file structures of the external files in one \fBhol\fR block.
 | 
						|
In the new compiler, every file structure is placed in a separate \fBbss\fR
 | 
						|
block. This implies that the arguments with which \fI_ini\fR is called are
 | 
						|
slightly different. The second argument was the base of the \fBhol\fR block
 | 
						|
to relocate the buffer addresses, it is changed into an integer denoting the
 | 
						|
size of the array passed as third argument. The third argument was a pointer
 | 
						|
to an array of integers containing the description of external files, this
 | 
						|
argument is changed into a pointer to an array of pointers to file structures.
 | 
						|
 | 
						|
The differences in the generated EM code for an arbitrary Pascal program are
 | 
						|
listed below (only the relevant parts are shown):
 | 
						|
.in +5m
 | 
						|
.nf
 | 
						|
\fBprogram\fR external_files(output,f);
 | 
						|
\fBvar\fR
 | 
						|
	f : \fBfile of \fIsome-type\fR;
 | 
						|
   .
 | 
						|
   .
 | 
						|
\fBend\fR.
 | 
						|
.in -5m
 | 
						|
 | 
						|
EM code generated by Pascal-VU:
 | 
						|
.in +5m
 | 
						|
   .
 | 
						|
   .
 | 
						|
 hol 1088,-2147483648,0    ; space belonging to file structures of the program arguments
 | 
						|
   .
 | 
						|
   .
 | 
						|
   .
 | 
						|
\&.2
 | 
						|
 con 3, -1, 544, 0         \h'80u'; description of external files
 | 
						|
 lxl 0
 | 
						|
 lae .2
 | 
						|
 lae 0                     \h'146u'; base of hol block, to relocate buffer addresses
 | 
						|
 lxa 0
 | 
						|
 cal $_ini
 | 
						|
 asp 16
 | 
						|
   .
 | 
						|
   .
 | 
						|
.in -5m
 | 
						|
 | 
						|
EM code generated by our compiler:
 | 
						|
.in +5m
 | 
						|
   .
 | 
						|
   .
 | 
						|
f
 | 
						|
 bss 540,0,0               \h'100u'; space belonging to file structure of program argument f
 | 
						|
output
 | 
						|
 bss 540,0,0               \h'100u'; space belonging to file structure of standard output
 | 
						|
   .
 | 
						|
   .
 | 
						|
   .
 | 
						|
\&.2
 | 
						|
 con 0U4, output, f        \h'50u'; the absence of standard input is denoted by a null pointer
 | 
						|
 lxl 0
 | 
						|
 lae .2
 | 
						|
 loc 3                     \h'144u'; denotes the size of the array of pointers to file structures
 | 
						|
 lxa 0
 | 
						|
 cal $_ini
 | 
						|
 asp 16
 | 
						|
   .
 | 
						|
   .
 | 
						|
.in -5m
 | 
						|
 | 
						|
.po
 | 
						|
The following files in the run time library have been changed:
 | 
						|
.in +1m
 | 
						|
pc_file.h
 | 
						|
hlt.c
 | 
						|
ini.c
 | 
						|
opn.c
 | 
						|
pentry.c
 | 
						|
pexit.c
 | 
						|
.in -1m
 | 
						|
.fi
 | 
						|
.bp
 | 
						|
.po
 |