pc_prlib.7 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. .\" $Header$
  2. .TH PC_PRLIB 7ACK
  3. .ad
  4. .SH NAME
  5. pc_prlib \- library of Pascal runtime routines
  6. .SH SYNOPSIS
  7. .ta 11n 22n 33n 44n 55n
  8. .nf
  9. type alpha=packed array[1..8] of char;
  10. pstring= ^packed array[] of char;
  11. function _abi(i:integer):integer;
  12. function _abl(i:long):long;
  13. function _mdi(j,i:integer):integer;
  14. function _mdl(j,i:long):long;
  15. function _abr(r:real):real;
  16. function _sin(r:real):real;
  17. function _cos(r:real):real;
  18. function _atn(r:real):real;
  19. function _exp(r:real):real;
  20. function _log(r:real):real;
  21. function _sqt(r:real):real;
  22. function _rnd(r:real):real;
  23. type compared=-1..1;
  24. gotoinfo=record
  25. pcoffset:^procedure; { procedure id. without static link }
  26. nlocals: integer;
  27. end;
  28. function _bcp(sz:integer; s2,s1:pstring):compared;
  29. function _bts(size,high,low:integer; base:^set 0..(8*size-1))
  30. :set of 0..(8*size-1);
  31. procedure _gto(lb:^integer; p:^gotoinfo);
  32. procedure _new(size:integer; var p:^integer);
  33. procedure _dis(size:integer; var p:^integer);
  34. procedure _sav(var p:^integer);
  35. procedure _rst(var p:^integer);
  36. type arrdescr=record
  37. lowbnd: integer;
  38. diffbnds:integer;
  39. elsize: integer;
  40. end;
  41. arr1=array[] of ?;
  42. arr2=packed array[] of ?;
  43. procedure _pac(var ad,zd:arrdescr; var zp:arr2; i:integer;
  44. var ap:arr1);
  45. procedure _unp(var ad,zd:arrdescr; i:integer; var ap:arr1;
  46. var zp:arr2;);
  47. function _asz(var dp:arrdescr):integer;
  48. procedure _ass(line:integer; b:boolean);
  49. procedure procentry(var name:alpha);
  50. procedure procexit(var name:alpha);
  51. const lowbyte=[0..7];
  52. MAGIC =[1,3,5,7];
  53. WINDOW =[11];
  54. ELNBIT =[12];
  55. EOFBIT =[13];
  56. TXTBIT =[14];
  57. WRBIT =[15];
  58. type file=record
  59. ptr: ^char;
  60. flags: set of [0..15];
  61. fname: string;
  62. ufd: 0..15;
  63. size: integer;
  64. count: 0..buflen;
  65. buflen: max(512,size) div size * size;
  66. bufadr: packed array[1..max(512,size)]
  67. of char;
  68. end;
  69. filep=^file;
  70. const NFILES=15;
  71. _extfl:^array[] of filep;
  72. procedure _ini(var args:integer; var hb:integer;
  73. var p:array[] of filep; var mainlb:integer);
  74. procedure _hlt(status:0..255);
  75. procedure _opn(size:integer; f:filep);
  76. procedure _cre(size:integer; f:filep);
  77. procedure _cls(f:filep);
  78. procedure _get(f:filep);
  79. procedure _put(f:filep);
  80. function _wdw(f:filep):^char;
  81. function _efl(f:filep):boolean;
  82. function _eln(f:filep):boolean;
  83. function _rdc(f:filep):char;
  84. function _rdi(f:filep):integer;
  85. function _rdl(f:filep):long;
  86. function _rdr(f:filep):real;
  87. procedure _rln(f:filep);
  88. procedure _wrc(c:char; f:filep);
  89. procedure _wsc(w:integer; c:char; f:filep);
  90. procedure _wri(i:integer; f:filep);
  91. procedure _wsi(w:integer; i:integer; f:filep);
  92. procedure _wrl(l:long; f:filep);
  93. procedure _wsl(w:integer; l:long; f:filep);
  94. procedure _wrr(r:real; f:filep);
  95. procedure _wsr(w:integer; r:real; f:filep);
  96. procedure _wrf(ndigit:integer; w:integer; r:real; f:filep);
  97. procedure _wrs(l:integer; s:pstring; f:filep);
  98. procedure _wss(w:integer; l:integer; s:pstring; f:filep);
  99. procedure _wrb(b:boolean; f:filep);
  100. procedure _wsb(w:integer; b:boolean; f:filep);
  101. procedure _wrz(s:string; f:filep);
  102. procedure _wsz(w:integer; s:string; f:filep);
  103. procedure _wln(f:filep);
  104. procedure _pag(f:filep);
  105. .fi
  106. .SH DESCRIPTION
  107. This library is used by the Pascal to EM compiler and
  108. contains all the runtime routines for standard Pascal programs.
  109. Most routines are written in C, a few in EM assembly language.
  110. These routines can be divided into several categories.
  111. A description of each category with its routines follows.
  112. .PP
  113. Arithmetic routines:
  114. .RS
  115. .IP _abi
  116. Compute the absolute value of an integer.
  117. .PD 0
  118. .IP _abl
  119. Compute the absolute value of a long.
  120. .IP _mdi
  121. Perform the Pascal modulo operation on integers.
  122. .IP _mdl
  123. Perform the Pascal modulo operation on longs.
  124. .IP _abr
  125. Compute the absolute value of a real.
  126. .IP _sin
  127. Compute the sine of a real.
  128. .IP _cos
  129. Compute the cosine of a real.
  130. .IP _atn
  131. Compute the arc tangent of a real.
  132. .IP _exp
  133. Compute the e-power of a real.
  134. .IP _log
  135. Compute the natural logarithm of a real.
  136. .IP _sqt
  137. Compute the square root of a real.
  138. .IP _rnd
  139. Return a real that when truncated will
  140. result in the nearest integer (-3.5->-4).
  141. .PD
  142. .PP
  143. .RE
  144. Miscellaneous routines:
  145. .RS
  146. .IP _bcp
  147. Compare two strings. Use dictionary ordering with the ASCII
  148. character set. The EM instruction CMU can not be used, because it needs
  149. an even number of bytes.
  150. .PD 0
  151. .IP _bts
  152. Include a range of elements from low to high in a set of size bytes
  153. at address base.(size can be divided by the wordsize)
  154. .IP _gto
  155. Execute a non-local goto. Lb points to the
  156. local base of the target procedure.
  157. A lb of zero indicates a jump to the program body, the lb of the main
  158. program is found in _m_lb, which is set by _ini.
  159. The new EM stack pointer is calculated by adding the number of locals
  160. to the new local base
  161. (jumping into statements is not allowed; there are no local generators
  162. in Pascal!).
  163. .PD
  164. .PP
  165. .RE
  166. Heap management:
  167. .RS
  168. .PP
  169. There is one way to allocate new heap space (_new), but two different
  170. incompatible ways to deallocate it.
  171. .PP
  172. The most general one is by using dispose (_dis).
  173. A circular list of free blocks, ordered from low to high addresses, is maintained.
  174. Merging free blocks is done when a new block enters the free list.
  175. When a new block is requested (_new), the free list is searched using a
  176. first fit algorithm.
  177. Two global variables are needed:
  178. .IP _highp 10
  179. Points to the free block with the highest address.
  180. .PD 0
  181. .IP _lastp
  182. Points to the most recently entered free block or to a block
  183. in the neighborhood of the most recently allocated block.
  184. .PD
  185. The free list is empty, when one of these pointers (but then at the same
  186. time both) is zero.
  187. .PP
  188. The second way to deallocate heap space is by using
  189. mark (_sav) and release (_rst). Mark saves the current value of the
  190. heap pointer HP in the program variable passed as a parameter.
  191. By calling release with this old HP value as its argument, the old HP value
  192. is restored, effectively deallocating all blocks requested between
  193. the calls to mark and release.
  194. The heap is used as second stack in this case.
  195. .PP
  196. It will be clear that these two ways of deallocating heap space
  197. can not be used together.
  198. To be able to maintain the free list, all blocks must be a multiple
  199. of n bytes long, with a minimum of n bytes,
  200. where n is the sum of the size of a word and a pointer in the
  201. EM implementation used.
  202. .PP
  203. In summary:
  204. .IP _new
  205. Allocate heap space.
  206. .PD 0
  207. .IP _dis
  208. Deallocate heap space.
  209. .IP _sav
  210. Save the current value of HP.
  211. .IP _rst
  212. Restore an old value of HP.
  213. .PD
  214. .PP
  215. .RE
  216. Array operations:
  217. .RS
  218. .PP
  219. The only useful form of packing implemented, is packing bytes into words.
  220. All other forms of packing and unpacking result in a plain copy.
  221. .IP _pac
  222. Pack an unpacked array \fIa\fP into a packed array \fIz\fP.
  223. \fIap\fP and \fIzp\fP
  224. are pointers to \fIa\fP and \fIz\fP. \fIad\fP and \fIzd\fP
  225. are pointers to the descriptors of \fIa\fP and \fIz\fP. \fIi\fP is
  226. the index in \fIa\fP of the first element to be packed.
  227. Pack until \fIz\fP is full.
  228. .PD 0
  229. .IP _unp
  230. Unpack \fIz\fP into \fIa\fP.
  231. \fIap\fP, \fIzp\fP, \fIad\fP and \fIzd\fP are as for _pac. \fIi\fP is
  232. the index in \fIa\fP where the first element of \fIz\fP is copied into.
  233. Unpack all elements of \fIz\fP.
  234. .IP _asz
  235. Compute array size. Used for copying conformant arrays.
  236. .PD
  237. .PP
  238. .RE
  239. Debugging facilities:
  240. .RS
  241. The compiler allows you to verify assertions.
  242. It generates a call to the routine _ass to check the assertion at runtime.
  243. Another feature of the compiler is that it enables you to trace the
  244. procedure calling sequence. If the correct option is turned on, then
  245. a call to the procedure \fIprocentry\fP is generated at the start of each
  246. compiled procedure or function. Likewise, the routine \fIprocexit\fP is called
  247. just before a procedure or function exits.
  248. Default procedure \fIprocentry\fP
  249. and \fIprocexit\fP are available in this library.
  250. .IP _ass 10
  251. If \fIb\fP is zero, then change eb[0] to \fIline\fP
  252. (to give an error message with source line number) and call the error routine.
  253. .PD 0
  254. .IP procentry
  255. Print the name of the called procedure with up to seven argument words
  256. in decimal on standard output. Output must be declared in the program heading.
  257. .IP procexit
  258. Print the name of the procedure that is about to exit.
  259. Same remarks as for procentry.
  260. .PD
  261. .PP
  262. .RE
  263. Files:
  264. .RS
  265. .PP
  266. Most of the runtime routines are needed for file handling.
  267. For each file in your Pascal program a record of type file, as described
  268. above, is allocated, static if your file is declared in the outermost block,
  269. dynamic if it is declared in inner blocks.
  270. The fields in the file record are used for:
  271. .IP bufadr 10
  272. IO is buffered except for standard input and output if
  273. terminals are involved. The size of the buffer is the maximum of 512
  274. and the file element size.
  275. .PD 0
  276. .IP buflen
  277. The effective buffer length is the maximum number of file elements
  278. fitting in the buffer, multiplied by the element size.
  279. .IP size
  280. The file element size (1 or even).
  281. .IP flags
  282. Some flag bits are stored in the high byte and a magic pattern
  283. in the low byte provides detection of destroyed file
  284. information.
  285. .IP ptr
  286. Points to the file window inside the buffer.
  287. .IP count
  288. The number of bytes (the window inclusive) left in the buffer
  289. to be read or the number of free bytes (the window inclusive) for output files.
  290. .IP ufd
  291. The UNIX file descriptor for the file.
  292. .IP fname
  293. Points to the name of the file (INPUT for standard input,
  294. OUTPUT for standard output and LOCAL for local files).
  295. This field is used for generating error messages.
  296. .PD
  297. .PP
  298. The constants used by the file handling routines are:
  299. .IP WINDOW 10
  300. Bit in flags set if the window of an input file is initialized.
  301. Used to resolve the famous interactive input problem.
  302. .PD 0
  303. .IP EOFBIT
  304. Bit in flags set if end of file seen
  305. .IP ELNBIT
  306. Bit in flags set if linefeed seen
  307. .IP TXTBIT
  308. Bit in flags set for text files. Process linefeeds.
  309. .IP WRBIT
  310. Bit in flags set for output files
  311. .IP MAGIC
  312. Pattern for the low byte of flags
  313. .IP NFILES
  314. The maximum number of open files in UNIX
  315. .PD
  316. .PP
  317. .RE
  318. Prelude and postlude:
  319. .RS
  320. .PP
  321. These routines are called once for each Pascal program:
  322. .IP _ini
  323. When a file mentioned in the program heading is opened by reset or
  324. rewrite, its file pointer must be mapped onto one of the program
  325. arguments.
  326. The compiler knows how to map and therefore builds a table with
  327. a pointer to the file structure for each program argument.
  328. One of the first actions of the Pascal program is to call this procedure
  329. with this table as an argument.
  330. The global variable _extfl is used to save the address of this table.
  331. Another task of _ini is to initialize the standard input and output files.
  332. For standard output it must decide whether to buffer or not.
  333. If standard output is a terminal, then buffering is off by setting
  334. buflen to 1.
  335. Two other task of _ini are the copying of two pointers from
  336. the argument list to global memory, mainlb to _m_lb and hb to _hbase.
  337. The first contains the local base of the program body, the second
  338. contains the address of the hol containing the global variables
  339. of the program.
  340. A last task of _ini is to set the global variables _argc, _argv and _environ
  341. from args for
  342. possible reference later on.
  343. Args points to the argument count placed on the stack by the EM runtime system,
  344. see chapter 8 in [1].
  345. .PD 0
  346. .IP _hlt
  347. If the program is about to finish, the buffered files must be flushed.
  348. That is done by this procedure.
  349. .PD
  350. .PP
  351. .RE
  352. Opening and closing:
  353. .RS
  354. .PP
  355. Files in Pascal are opened for reading by reset and opened for writing by
  356. rewrite.
  357. Files to be rewritten may or may not exist already.
  358. Files not mentioned in the program heading are considered local files.
  359. The next steps must be done for reset and rewrite:
  360. .IP 1.
  361. If size is zero, then a text file must be opened with elements of
  362. size 1.
  363. .PD 0
  364. .IP 2.
  365. Find out if this file is mentioned in the program heading
  366. (scan table pointed to by _extfl).
  367. If not, then it is a local file and goto 7.
  368. .IP 3.
  369. If the file is standard input or output then return.
  370. .IP 4.
  371. If there are not enough arguments supplied, generate an error.
  372. .IP 5.
  373. If the file was already open, flush the buffer if necessary and close it.
  374. Note that reset may be used to force the buffer to be flushed.
  375. This is sometimes helpful against program or system crashes.
  376. .IP 6.
  377. If it is a reset, open the file, otherwise create it.
  378. In both cases goto 9.
  379. .IP 7.
  380. If the local file is to be written, then close it if it was open and
  381. create a new nameless file. First try to create it in /usr/tmp, then in /tmp
  382. and if both fail then try the current directory.
  383. See to it that the file is open for both reading and writing.
  384. .IP 8.
  385. If the local file is to be read
  386. and the file is opened already, then
  387. flush the buffer and seek to the beginning.
  388. Otherwise open a temporary file as described in 7.
  389. .IP 9.
  390. Initialize all the file record fields.
  391. .PD
  392. .PP
  393. The necessary procedures are:
  394. .IP _opn
  395. Reset a file
  396. .PD 0
  397. .IP _cre
  398. Rewrite a file
  399. .IP _cls
  400. Close a file. Closing of files is done for local files when the procedure
  401. in which they are declared exits.
  402. The compiler only closes local files if they are not part of a structured type.
  403. Files allocated in the heap are not closed when they are deallocated.
  404. There is an external routine \fIpclose\fP in libP(VII), that may be called
  405. explicitly to do the closing in these cases.
  406. Closing may be necessary to flush buffers or to keep the number of
  407. simultaneously opened files below NFILES.
  408. Files declared in the outermost block are automatically closed when the
  409. program terminates.
  410. .PD
  411. .PP
  412. .RE
  413. General file IO:
  414. .RS
  415. .PP
  416. These routines are provided for general file IO:
  417. .IP _put
  418. Append the file element in the window to the file and advance the
  419. window.
  420. .IP _get
  421. Advance the file window so that it points to the next element
  422. of the file.
  423. For text files (TXTBIT on) the ELNBIT in flags is set if the new character
  424. in the window is a line feed (ASCII 10) and the character is then changed
  425. into a space.
  426. Otherwise the ELNBIT is cleared.
  427. .IP _wdw
  428. Return the current pointer to the file window.
  429. .IP _eof
  430. Test if you reached end of file.
  431. Is always true for output files.
  432. .PD
  433. .PP
  434. .RE
  435. Textfile routines:
  436. .RS
  437. .PP
  438. The rest of the routines all handle text files.
  439. .IP _eln
  440. Return true if the next character on an input file is an end-of-line marker.
  441. An error occurs if eof(f) is true.
  442. .PD 0
  443. .IP _rdc
  444. Return the character currently in the window and advance the window.
  445. .IP _rdi
  446. Build an integer from the next couple of characters on the file,
  447. starting with the character in the window.
  448. The integer may be preceded by spaces (and line feeds), tabs and a sign.
  449. There must be at least one digit.
  450. The first non-digit signals the end of the integer.
  451. .IP _rdl
  452. Like _rdi, but for longs.
  453. .IP _rdr
  454. Like _rdi, but for reals. Syntax is as required for Pascal.
  455. .IP _rln
  456. Skips the current line and clears the WINDOW flag, so that the
  457. next routine requiring an initialized window knows that it has to
  458. fetch the next character first.
  459. .IP _wrc
  460. Write a character, not preceeded by spaces.
  461. .IP _wsc
  462. Write a character, left padded with spaces up to a field width
  463. of \fIw\fP.
  464. .IP _wri
  465. Write an integer, left padded with spaces up to a field width
  466. of 6.
  467. .IP _wsi
  468. Write an integer, left padded with spaces up to a field width
  469. of \fIw\fP.
  470. .IP _wrl
  471. Write a long, left padded with spaces up to a field width
  472. of 11.
  473. .IP _wsl
  474. Write a long, left padded with spaces up to a field width
  475. of \fIw\fP.
  476. .IP _wrr
  477. Write a real in scientific format,
  478. left padded with spaces up to a field width of 13.
  479. .IP _wsr
  480. Write a real in scientific format,
  481. left padded with spaces up to a field width of \fIw\fP.
  482. .IP _wrf
  483. Write a real in fixed point format, with exactly \fIndigit\fP digits
  484. behind the decimal point, the last one rounded; it is left padded up to
  485. a field width of \fIw\fP.
  486. .IP _wrs
  487. Write a string of length \fIl\fP, without additional spaces.
  488. .IP _wss
  489. Write a string of length \fIl\fP, left padded up to a field
  490. width of \fIw\fP.
  491. .IP _wrb
  492. Write a boolean, represented by "true" or "false", left padded
  493. up to a field width of 5.
  494. .IP _wsb
  495. Write a boolean, represented by "true" or "false", left padded
  496. up to a field width of \fIw\fP.
  497. .IP _wrz
  498. Write a C-type string up to the zero-byte.
  499. .IP _wsz
  500. Write a C-type string, left padded up to a field width of w.
  501. .IP _wln
  502. Write a line feed (ASCII 10).
  503. .IP _pag
  504. Write a form feed (ASCII 12).
  505. .PD
  506. .PP
  507. .RE
  508. All the routines to which calls are generated by the compiler are described above.
  509. They use the following global defined routines to do some of the work:
  510. .IP _rf 10
  511. Check input files for MAGIC and WRBIT.
  512. Initialize the window if WINDOW is cleared.
  513. .PD 0
  514. .IP _wf
  515. Check output files for MAGIC and WRBIT.
  516. .IP _incpt
  517. Advance the file window and read a new buffer if necessary.
  518. .IP _outcpt
  519. Write out the current buffer if necessary and advance the window.
  520. .IP _flush
  521. Flush the buffer if it is an output file.
  522. Append an extra line marker if EOLBIT is off.
  523. .IP _wstrin
  524. All output routines make up a string in a local buffer.
  525. They call _wstrin to output this buffer and to do the left padding.
  526. .IP _skipsp
  527. Skip spaces (and line feeds) on input files.
  528. .IP _getsig
  529. Read '+' or '-' if present.
  530. .IP _fstdig
  531. See to it that the next character is a digit. Otherwise error.
  532. .IP _nxtdig
  533. Check if the next character is a digit.
  534. .IP _getint
  535. Do the work for _rdi.
  536. .IP _ecvt
  537. Convert real into string of digits for printout in scientific notation.
  538. .IP _fcvt
  539. Convert real into string of digits for fixed point printout
  540. .IP -fif
  541. Split real into integer and fraction part
  542. .IP _fef
  543. Split real into exponent and fraction part
  544. .PD
  545. .PP
  546. The following global variables are used:
  547. .IP _lastp 10
  548. For heap management (see above).
  549. .PD 0
  550. .IP _highp
  551. For heap management (see above).
  552. .IP _extfl
  553. Used to save the argument p of _ini for later reference.
  554. .IP _hbase
  555. Used to save the argument hb of _ini for later reference.
  556. .IP _m_lb
  557. Used to store the local base of the main program.
  558. .IP _curfil
  559. Save the current file pointer, so that the
  560. error message can access the file name.
  561. .IP "_pargc, _pargv, _penvp"
  562. Used to access the arguments of the main program.
  563. .PD
  564. .SH FILES
  565. .IP ~em/lib/*/tail_pc 20
  566. The library used by ack[5] to link programs.
  567. .IP ~em/etc/pc_rterrors
  568. The error messages
  569. .PD
  570. .SH "SEE ALSO"
  571. .IP [1]
  572. A.S. Tanenbaum, Ed Keizer, Hans van Staveren & J.W. Stevenson
  573. "Description of a machine architecture for use of
  574. block structured languages" Informatica rapport IR-81.
  575. .PD 0
  576. .IP [2]
  577. K.Jensen & N.Wirth
  578. "PASCAL, User Manual and Report" Springer-Verlag.
  579. .IP [3]
  580. An improved version of the ISO standard proposal for the language Pascal
  581. ISO/TC97/SC5-N462, received November 1979.
  582. .IP [4]
  583. Ed Keizer, "The Amsterdam Compiler Kit reference manual".
  584. .br
  585. (try \fInroff ~em/doc/pcref.doc\fP).
  586. .IP [5]
  587. ack(1), pc_pem(6)
  588. .PD
  589. .SH DIAGNOSTICS
  590. All errors discovered by this runtime system cause an EM TRP instruction
  591. to be executed. This TRP instruction expects the error number on top
  592. of the stack. See [1] for a more extensive treatment of the subject.
  593. .PP
  594. EM allows the user to specify a trap handling routine, called whenever
  595. an EM machine trap or a language or user defined trap occurs.
  596. One of the first actions in _ini is to specify that the routine _fatal,
  597. available in this library, will handle traps.
  598. This routine is called with an error code (0..252) as argument.
  599. The file "~em/etc/pc_rterrors" is opened and searched for a message
  600. corresponding with this number.
  601. If the file can not be opened, or if the error number is not recorded
  602. in the file, then the same trap is generated again, but without
  603. a user-defined trap handler, so that the low levels generate an
  604. error message.
  605. Otherwise the following information is printed
  606. on file descriptor 2:
  607. .IP -
  608. The name of the Pascal program
  609. .PD 0
  610. .IP -
  611. The name of the file pointed to by _curfil, if the error number
  612. is between 96 and 127 inclusive.
  613. .IP -
  614. The error message (or the error number if not found).
  615. .IP -
  616. The source line number if not equal to 0.
  617. .PD
  618. .PP
  619. The routine _fatal stops the program as soon as the message is printed.
  620. .PP
  621. The following error codes are used by the Pascal runtime system:
  622. .IP 64
  623. more args expected
  624. .PD 0
  625. .IP 65
  626. error in exp
  627. .IP 66
  628. error in ln
  629. .IP 67
  630. error in sqrt
  631. .IP 68
  632. assertion failed
  633. .IP 69
  634. array bound error in pack
  635. .IP 70
  636. array bound error in unpack
  637. .IP 71
  638. only positive j in \fIi mod j\fP
  639. .IP 72
  640. file not yet open
  641. .IP 73
  642. dispose error
  643. .sp
  644. .IP 96
  645. file xxx: not writable
  646. .IP 97
  647. file xxx: not readable
  648. .IP 98
  649. file xxx: end of file
  650. .IP 99
  651. file xxx: truncated
  652. .IP 100
  653. file xxx: reset error
  654. .IP 101
  655. file xxx: rewrite error
  656. .IP 102
  657. file xxx: close error
  658. .IP 103
  659. file xxx: read error
  660. .IP 104
  661. file xxx: write error
  662. .IP 105
  663. file xxx: digit expected
  664. .IP 106
  665. file xxx: non-ASCII char read
  666. .PD
  667. .PP
  668. .SH AUTHORS
  669. Johan Stevenson and Ard Verhoog, Vrije Universiteit.