home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume23 / lome / part09 < prev    next >
Encoding:
Internet Message Format  |  1991-01-08  |  47.6 KB

  1. Path: j.cc.purdue.edu!mentor.cc.purdue.edu!purdue!bu.edu!rpi!julius.cs.uiuc.edu!wuarchive!uunet!papaya.bbn.com!rsalz
  2. From: rsalz@bbn.com (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v23i059:  Line oriented macro processor, Part09/09
  5. Message-ID: <3034@litchi.bbn.com>
  6. Date: 29 Nov 90 17:45:19 GMT
  7. Organization: BBN Systems and Technologies, Cambridge MA
  8. Lines: 1541
  9. Approved: rsalz@uunet.UU.NET
  10.  
  11. Submitted-by: Darren New <new@ee.udel.edu>
  12. Posting-number: Volume 23, Issue 59
  13. Archive-name: lome/part09
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 7 (of 9)."
  22. # Contents:  LOME/SCM.doc LOME/SCMTestC.out PPL/PPLAmiga.h
  23. # Wrapped by new@estelle.ee.udel.edu on Tue Aug 14 16:10:02 1990
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'LOME/SCM.doc' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'LOME/SCM.doc'\"
  27. else
  28. echo shar: Extracting \"'LOME/SCM.doc'\" \(14260 characters\)
  29. sed "s/^X//" >'LOME/SCM.doc' <<'END_OF_FILE'
  30. X
  31. XSCM (Simple Character Manipulator) is a language used to write a
  32. Xsophiticated macro expander. It is designed to be compiled by Comp1,
  33. Xand as such is very simple and not particularly easy to read or use,
  34. Xbut is particularly easy to implement. The syntax and semantics are
  35. Xdescribed herein.
  36. X
  37. XThe SCM language is based on a simple abstract machine. The memory of
  38. Xthis machine is organized into "cells" which can hold a two-bit flag,
  39. Xan eight-bit unsigned value, and a pointer to a cell (an address). The
  40. Xmemory consists of 36 single-cell registers and a memory space of
  41. Xnumbered cells (i.e., an array of cells). Each SCM program may have up
  42. Xto 99 labels, numbered 01 through 99. Up to 26 subroutines may be
  43. Xwritten and used. All operations except GET and PUT are performed on
  44. Xregisters; only GET and PUT address the general memory. Neither the
  45. Xregisters not the program code are in memory addressable by the GET
  46. Xand PUT instructions. There are only limited capabilities for literals
  47. Xavailable, but some of the registers are initialized to various
  48. Xconstants which are probably unwise to overwrite.
  49. X
  50. XThe registers are names A, B, C, ..., Y, Z, 0, 1, ..., 8, 9. That is,
  51. Xlegal register names include all upper case letters and all digits.
  52. XEach cell consists of three fields: FLG is a two-bit flag field taking
  53. Xthe values 0, 1, 2, or 3. VAL is an eight-bit field taking the values
  54. X0 through 255. PTR is a signed field large enough to address the
  55. Xlowest-numbered and highest-numbered cells in the memory array. It is
  56. Xexpected that this field will be at least 16 bits long. The VAL field
  57. Xmay be used to store either characters or string lengths. The PTR
  58. Xfield may be used to store addresses of memory cells or general signed
  59. Xintegers.
  60. X
  61. XThere are six general classes of instructions in the SCM language:
  62. Xdeclaration statements, control statements, data movement statements,
  63. Xarithmetic statements, branch statements, and I/O statements. These
  64. Xstatements are described below. In the descriptions of the statements,
  65. Xa single dollar sign represents the name of a register; a double
  66. Xdollar sign represents a two-digit label. In the text explaining the
  67. Xsemantics, R1 represents the first register parameter, R2 the second
  68. Xregister parameter, L1 the first label parameter, L2 the second label
  69. Xparameter, and so on.
  70. X
  71. XSince there are no literals, the interpreter (or macros) for SCM must
  72. Xinitialize certain registers before executing the first user
  73. Xstatement. The registers whose names are digits must be initialized as
  74. Xindicated below:
  75. X
  76. XReg     VAL     FLG     PTR
  77. X---     ---     ---     ---
  78. X0       0       0       0
  79. X1       1       1       1
  80. X2       2       2       2
  81. X3       3       3       3
  82. X4       4               4
  83. X5       5               5
  84. X6       6               10
  85. X7       7
  86. X8       8               The lowest value legal for the PTR R2 field in
  87. X                        the GET instruction.
  88. X9       9               The lowest value not legal for the PTR R1
  89. X                        field in the PUT instruction.
  90. X
  91. X
  92. X
  93. X
  94. X                    Declaration statements:
  95. X
  96. XBEGIN PROGRAM.
  97. XThis must be the first statement in any SCM program. No instruction
  98. Xmay appear between the BEGIN PROGRAM and the first BEGIN MAIN ROUTINE
  99. Xor BEGIN SUBROUTINE $.
  100. X
  101. XEND PROGRAM.
  102. XThis must be the last instruction in any SCM program.
  103. X
  104. XBEGIN MAIN ROUTINE.
  105. XThis immediately preceeds the first statement to be executed by the
  106. Xprogram. It must appear in any program.
  107. X
  108. XEND MAIN ROUTINE.
  109. XThis immediately preceeds END PROGRAM, and if execution reaches this
  110. Xstatement the program is terminated successfully. It must appear in
  111. Xevery program.
  112. X
  113. XBEGIN SUBROUTINE $.
  114. XThis immediately preceeds the first instruction of subroutine R1. This
  115. Xmay appear at most once for any given register. This must preceed the
  116. Xcorresponding END SUBROUTINE R1 and must preceed BEGIN MAIN ROUTINE.
  117. XAlso, this may not appear when more BEGIN SUBROUTINE statements than
  118. XEND SUBROUTINE statements have appeared. I.e., subroutines do not
  119. Xnest and must preceed the main program. Instructions executed between
  120. Xa BEGIN SUBROUTINE R1 and an END SUBROUTINE R1 should not reference or
  121. Xalter R1, which may be being used to hold the return address.
  122. X
  123. XEND SUBROUTINE $.
  124. XThis immediately follows the last instruction to be executed as part
  125. Xof subroutine R1. It must follow BEGIN SUBROUTINE R1 and must appear
  126. Xif BEGIN SUBROUTINE R1 appears. When execution reaches this statement,
  127. Xcontrol is transfered to the instruction following the most recently
  128. Xexecuted CALL R1 instuction. This must preceed the BEGIN MAIN ROUTINE
  129. Xinstruction. No instructions may appear between an END SUBROUTINE $
  130. Xand the next BEGIN SUBROUTINE or BEGIN MAIN ROUTINE.
  131. X
  132. XLABEL $$.
  133. XThis marks the destination of a branch instruction. At execution time,
  134. Xit does nothing. L1 must not match L1 of any other LABEL $$
  135. Xinstruction anywhere in the program.
  136. X
  137. XCHRDATA $$ $ $ $$.
  138. XThis must only follow a BEGIN MAIN ROUTINE statement, a CHRDATA
  139. Xstatement, or a NUMDATA statement. It sets the memory location at
  140. Xposition (R1*10+R2) (where R1, R2 are digits) to have the FLG field of
  141. XR3 (0,1,2,3) and the VAL field of R4 (any character) and the PTR field
  142. Xof (R5*10+R6) (where R5, R6 are digits).
  143. X
  144. XNUMDATA $$ $ $$ $$.
  145. XThis must only follow a BEGIN MAIN ROUTINE statement, a CHRDATA
  146. Xstatement, or a NUMDATA statement. It sets the memory location at
  147. Xposition (R1*10+R2) (where R1, R2 are digits) to have the FLG field of
  148. XR3 (0,1,2,3) and the VAL field of (R4*10+R5) (where R4, R5 are digits)
  149. Xand the PTR field of (R6*10+R7) (where R6, R7 are digits).
  150. X
  151. X
  152. X
  153. X
  154. X                    Control statements:
  155. X
  156. XSTOP $.
  157. XThis terminates execution of the program. It is intended that the
  158. Xtermination be considered "abnormal" or as the result of an error. The
  159. Xcontents of register R1 should be displayed to the user if possible.
  160. X
  161. XCALL $.
  162. XThis causes execution to begin at the first instruction following the
  163. Xstatement BEGIN SUBROUTINE R1. The contents of R1 may be destroyed by
  164. Xthis instruction. Execution resumes at the instruction following CALL
  165. XR1 when the END SUBROUTINE R1 is executed. It is illegal to execute
  166. XCALL R1 between the time a CALL R1 is executed and an END SUBROUTINE
  167. XR1 is executed; i.e., subroutines are not recursive.
  168. X
  169. X                    Data Movement statements:
  170. X
  171. XGET $ = MEM $.
  172. XThis reads the fields from the memory array cell addressed by the PTR
  173. Xfield of the R2 register and stores them in R1. Neither the memory
  174. Xnor R2 are changed by this instruction; R1's old contents are lost.
  175. XNote that the PTR field may be implemented as an actual memory
  176. Xaddress, as an array subscript, or something else altogether.
  177. XTherefore, generation of memory array pointers requires the use of the
  178. XMOV PTR $ = $ instruction.
  179. X
  180. XPUT MEM $ = $.
  181. XThis writes the fields from R2 into the memory array cell addressed by
  182. Xthe PTR field of R1. Neither R1 nor R2 are changed by this
  183. Xinstruction; the old contents of the memory cell are lost.
  184. X
  185. XFLG $ = $.
  186. XThe FLG field of R1 is overwritten with the contents of the FLG field
  187. Xof R2. R2 is not changed.
  188. X
  189. XPTR $ = VAL $.
  190. XThe PTR field of R1 is overwritten with the contents of the VAL field
  191. Xof R2. R2 is not changed. PTR will always become a number from 0 to
  192. X255 as the result of this instruction.
  193. X
  194. XVAL $ = PTR $.
  195. XThe VAL field of R1 is overwritten with the contents of the PTR field
  196. Xof R2. R2 is not changed. VAL will always become a number from 0 to
  197. X255 as the result of this instruction; if the PTR field is outside of
  198. Xthis range, the contents of VAL R1 are undefined as the result of this
  199. Xinstruction.
  200. X
  201. X                    Arithmetic statements:
  202. X
  203. XVAL $ = $ + $.
  204. XThe VAL field of R1 is overwritten by the sum of the contents of the
  205. XVAL fields of R2 and R3. If the result is outside of the range 0
  206. Xthrough 255, the result in VAL R1 is undefined. The same register may
  207. Xappear any number of times in the statement; i.e., VAL A = A + A is
  208. Xlegal. No field is changed except VAL R1.
  209. X
  210. XVAL $ = $ - $.
  211. XThe VAL field of R1 is overwritten by the difference of the contents
  212. Xof the VAL fields of R2 and R3 (R2 - R3, not R3 - R2). If the result
  213. Xis outside of the range 0 through 255, the result in VAL R1 is
  214. Xundefined. The same register may appear any number of times in the
  215. Xstatement; i.e., VAL A = A - A is legal. No field is changed except
  216. XVAL R1.
  217. X
  218. XPTR $ = $ + $.
  219. XThe PTR field of R1 is overwritten by the sum of the contents of the
  220. XPTR fields of R2 and R3. If the result is outside of the range
  221. Xstorable in PTR fields, the result in PTR R1 is undefined. The same
  222. Xregister may appear any number of times in the statement; i.e., PTR A
  223. X= A + A is legal. No field is changed except PTR R1.
  224. X
  225. XPTR $ = $ - $.
  226. XThe PTR field of R1 is overwritten by the difference of
  227. Xthe contents of the PTR fields of R2 and R3 (R2 - R3, not R3 - R2). If
  228. Xthe result is outside of the range storable in PTR fields, the result
  229. Xin PTR R1 is undefined. The same register may appear any number of
  230. Xtimes in the statement; i.e., PTR A = A - A is legal. No field is
  231. Xchanged except PTR R1.
  232. X
  233. XPTR $ = $ * $.
  234. XThe PTR field of R1 is overwritten by the product of the contents of
  235. Xthe PTR fields of R2 and R3. If the result is outside of the range
  236. Xstorable in PTR fields, the result in PTR R1 is undefined. The same
  237. Xregister may appear any number of times in the statement; i.e., PTR A
  238. X= A * A is legal. No field is changed except PTR R1. The normal rules
  239. Xfor multiplying negative numbers apply.
  240. X
  241. XPTR $ = $ / $.
  242. XThe PTR field of R1 is overwritten by the quotient of the contents of
  243. Xthe PTR fields of R2 and R3 (R2 / R3, not R3 / R2). If the result is
  244. Xoutside of the range storable in PTR fields, the result in PTR R1 is
  245. Xundefined. The same register may appear any number of times in the
  246. Xstatement; i.e., PTR A = A / A is legal. No field is changed except
  247. XPTR R1. If the division results in a remainder, the remainder is
  248. Xdiscarded. The normal rules for dividing negative numbers apply.
  249. X
  250. XMOV PTR $ BY $.
  251. XThe PTR field of R1 is assumed to hold the address of
  252. Xa memory cell. PTR R1 is replaced by a pointer that is PTR R2 memory
  253. Xcells beyond where PTR R1 pointed before this instruction. If PTR R2
  254. Xis zero, no change is made; if PTR R2 is negative, PTR R1 is replaced
  255. Xby a pointer that is PTR R2 memory cells before where PTR R1 pointed
  256. Xbefore this instruction. Use of this instruction allows the
  257. Ximplementation to use more than one addressable unit per memory cell;
  258. Xnormall addition, subtraction, and so on may not yield valid memory
  259. Xcell addresses.
  260. X
  261. X                    Branch statements:
  262. X
  263. XTO $$.
  264. XThe next instruction to be executed will be the instruction following
  265. XLABEL L1. The LABEL L1 statement must appear and must not be separated
  266. Xfrom the TO L1 statement by a BEGIN MAIN ROUTINE or a BEGIN SUBROUTINE
  267. X$ statement. This must always be followed by a LABEL $$, END
  268. XSUBROUTINE $, or END MAIN PROGRAM statement.
  269. X
  270. XTO $$ IF FLG $ EQ $.
  271. XIf the FLG field of R1 has the same contents as the FLG field of R2,
  272. Xthis behaves identically to TO L1 (including the restrictions on
  273. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  274. X
  275. XTO $$ IF FLG $ NE $.
  276. XIf the FLG field of R1 has different contents from the FLG field of
  277. XR2, this behaves identically to TO L1 (including the restrictions on
  278. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  279. X
  280. XTO $$ IF VAL $ EQ $.
  281. XIf the VAL field of R1 has the same contents as the VAL field of R2,
  282. Xthis behaves identically to TO L1 (including the restrictions on
  283. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  284. X
  285. XTO $$ IF VAL $ NE $.
  286. XIf the VAL field of R1 has different contents from the VAL field of
  287. XR2, this behaves identically to TO L1 (including the restrictions on
  288. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  289. X
  290. XTO $$ IF PTR $ EQ $.
  291. XIf the PTR field of R1 has the same contents as the PTR field of R2,
  292. Xthis behaves identically to TO L1 (including the restrictions on
  293. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  294. X
  295. XTO $$ IF PTR $ NE $.
  296. XIf the PTR field of R1 has different contents from the PTR field of
  297. XR2, this behaves identically to TO L1 (including the restrictions on
  298. Xplacement of LABEL L1). Otherwise, this statement has no effect.
  299. X
  300. XTO $$ IF PTR $ LT $.
  301. XIf the contents of the PTR field of R1 is numerically less than the
  302. Xcontents from the PTR field of R2, this behaves identically to TO L1
  303. X(including the restrictions on placement of LABEL L1). Otherwise, this
  304. Xstatement has no effect.
  305. X
  306. X                    I/O statements:
  307. X
  308. XREWIND $.
  309. XThe VAL field must have a value from zero to nine. The indicated
  310. Xstream is rewound. If no error occurred, the FLG field of R1 will be
  311. Xset to zero; otherwise, it will be set to one. No other fields are
  312. Xchanged. The line buffer is not affected.
  313. X
  314. XGET BUFF $.
  315. XThe VAL field must have a value from zero to nine. The indicated
  316. Xstream is read using MGetBuff. If no error occurred, the FLG field of
  317. XR1 will be set to zero; if the end of the input stream is detected,
  318. Xthe FLG field of R1 will be set to one; if some other error is
  319. Xdetected, the FLG field will be set to two.
  320. X
  321. XPUT BUFF $.
  322. XThe VAL field must have a value from zero to nine. The indicated
  323. Xstream is written using MPutBuff. If no error occurred, the FLG field
  324. Xof R1 will be set to zero; if the end of the input stream is detected,
  325. Xthe FLG field of R1 will be set to one; if some other error is
  326. Xdetected, the FLG field will be set to two.
  327. X
  328. XVAL $ = INPUT.
  329. XThis uses MGetChar to retrieve the next input character from the line
  330. Xbuffer. The inputted character is placed in the VAL field of R1; no
  331. Xother field is changed. As usual, end-of-line is indicated by the
  332. Xreturned value being zero.
  333. X
  334. XOUTPUT = VAL $.
  335. XThis places the contents of the VAL field of R1 at the next location
  336. Xin the line buffer using MPutChar. If the buffer has filled, the VAL
  337. Xfield of R1 is set to zero; otherwise, no fields are changed.
  338. X
  339. XDEBUG.
  340. XThe implementation of this varies, but its intent is to produce output
  341. Xallowing a programmer in SCM to dump the registers and memory at
  342. Xspecific places in the code for debugging purposes.
  343. X
  344. XMESSAGE $$$$ TO $. This clears the line buffer, places the error message
  345. Xcontaining the string $$$$ into it, then puts it as if PUT BUFF R5 was
  346. Xcalled. This is kind of kludgy, and will be removed if I figure out how.
  347. XThe problem with removing it is not having constants for the characters
  348. Xwhich should be outputted.
  349. X
  350. X
  351. END_OF_FILE
  352. if test 14260 -ne `wc -c <'LOME/SCM.doc'`; then
  353.     echo shar: \"'LOME/SCM.doc'\" unpacked with wrong size!
  354. fi
  355. # end of 'LOME/SCM.doc'
  356. fi
  357. if test -f 'LOME/SCMTestC.out' -a "${1}" != "-c" ; then 
  358.   echo shar: Will not clobber existing file \"'LOME/SCMTestC.out'\"
  359. else
  360. echo shar: Extracting \"'LOME/SCMTestC.out'\" \(13523 characters\)
  361. sed "s/^X//" >'LOME/SCMTestC.out' <<'END_OF_FILE'
  362. X/*
  363. X * SCM Executable program.
  364. X * Generated by SCM Macros.
  365. X *
  366. X */
  367. X#include "PPL.h"
  368. X#include "MacroIO.h"
  369. X                        /* */
  370. X/* Declare the memory cells */
  371. X#define MEMSIZ 6000
  372. Xlong MEM[MEMSIZ];
  373. X                        /* */
  374. X/* Declare the registers */
  375. Xshort FA, FB, FC, FD, FE, FF, FG, FH, FI, FJ, FK, FL, FM;
  376. Xshort FN, FO, FP, FQ, FR, FS, FT, FU, FV, FW, FX, FY, FZ;
  377. Xshort F0, F1, F2, F3;
  378. Xshort VA, VB, VC, VD, VE, VF, VG, VH, VI, VJ, VK, VL, VM;
  379. Xshort VN, VO, VP, VQ, VR, VS, VT, VU, VV, VW, VX, VY, VZ;
  380. Xshort V0, V1, V2, V3, V4, V5, V6, V7, V8, V9;
  381. Xlong  PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK, PL, PM;
  382. Xlong  PN, PO, PP, PQ, PR, PS, PT, PU, PV, PW, PX, PY, PZ;
  383. Xlong  P0, P1, P2, P3, P4, P5, P6, P7, P8, P9;
  384. X                        /* */
  385. Xvoid Stop ARGS((short, short, long));
  386. Xvoid Oops ARGS((char *));
  387. X                        /* */
  388. Xvoid Stop ARGS3(short,flg,short,val,long,ptr)
  389. X{
  390. X    PLStatus(1, "Stop!");
  391. X    PLExit(PLsev_error);
  392. X    }
  393. X                        /* */
  394. Xvoid Oops ARGS1(char*,s)
  395. X{
  396. X    PLStatus(1, "Oops:");
  397. X    PLStatus(1, s);
  398. X    PLExit(PLsev_error);
  399. X    }
  400. X                        /* */
  401. X/* BEGIN PROGRAM. */
  402. X                        /* */
  403. X/* BEGIN SUBROUTINE F. */
  404. Xvoid SubF(void);
  405. Xvoid SubF()
  406. X{
  407. X    VB = V1 + V0;
  408. X    FB = MGetBuff(VB);
  409. X    VW = V2 + V0;
  410. X    FW = MPutBuff(VW);
  411. X/* END SUBROUTINE F. */
  412. X    return;
  413. X    }
  414. X/* BEGIN SUBROUTINE S. */
  415. Xvoid SubS(void);
  416. Xvoid SubS()
  417. X{
  418. X    VB = V1 + V0;
  419. X    FB = MGetBuff(VB);
  420. X    if (F1 == F1) goto LABEL03;
  421. X    VW = V2 + V0;
  422. X    FW = MPutBuff(VW);
  423. X    LABEL03:
  424. X    VB = V1 + V0;
  425. X    FB = MGetBuff(VB);
  426. X    if (F1 == F2) goto LABEL05;
  427. X    goto LABEL04;
  428. X    LABEL05:
  429. X    VW = V2 + V0;
  430. X    FW = MPutBuff(VW);
  431. X    LABEL04:
  432. X    VB = V1 + V0;
  433. X    FB = MGetBuff(VB);
  434. X    if (F1 != F1) goto LABEL06;
  435. X    goto LABEL07;
  436. X    LABEL06:
  437. X    VW = V2 + V0;
  438. X    FW = MPutBuff(VW);
  439. X    LABEL07:
  440. X    VB = V1 + V0;
  441. X    FB = MGetBuff(VB);
  442. X    if (F1 != F2) goto LABEL08;
  443. X    VW = V2 + V0;
  444. X    FW = MPutBuff(VW);
  445. X    LABEL08:
  446. X    VB = V1 + V0;
  447. X    FB = MGetBuff(VB);
  448. X    if (V1 == V1) goto LABEL09;
  449. X    VW = V2 + V0;
  450. X    FW = MPutBuff(VW);
  451. X    LABEL09:
  452. X    VB = V1 + V0;
  453. X    FB = MGetBuff(VB);
  454. X    if (V1 == V2) goto LABEL10;
  455. X    goto LABEL11;
  456. X    LABEL10:
  457. X    VW = V2 + V0;
  458. X    FW = MPutBuff(VW);
  459. X    LABEL11:
  460. X    VB = V1 + V0;
  461. X    FB = MGetBuff(VB);
  462. X    if (V1 != V1) goto LABEL12;
  463. X    goto LABEL13;
  464. X    LABEL12:
  465. X    VW = V2 + V0;
  466. X    FW = MPutBuff(VW);
  467. X    LABEL13:
  468. X    VB = V1 + V0;
  469. X    FB = MGetBuff(VB);
  470. X    if (V1 != V2) goto LABEL14;
  471. X    VW = V2 + V0;
  472. X    FW = MPutBuff(VW);
  473. X    LABEL14:
  474. X    VB = V1 + V0;
  475. X    FB = MGetBuff(VB);
  476. X    if (P1 == P1) goto LABEL15;
  477. X    VW = V2 + V0;
  478. X    FW = MPutBuff(VW);
  479. X    LABEL15:
  480. X    VB = V1 + V0;
  481. X    FB = MGetBuff(VB);
  482. X    if (P1 == P2) goto LABEL16;
  483. X    goto LABEL17;
  484. X    LABEL16:
  485. X    VW = V2 + V0;
  486. X    FW = MPutBuff(VW);
  487. X    LABEL17:
  488. X    VB = V1 + V0;
  489. X    FB = MGetBuff(VB);
  490. X    if (P1 != P1) goto LABEL18;
  491. X    goto LABEL19;
  492. X    LABEL18:
  493. X    VW = V2 + V0;
  494. X    FW = MPutBuff(VW);
  495. X    LABEL19:
  496. X    VB = V1 + V0;
  497. X    FB = MGetBuff(VB);
  498. X    if (P1 != P2) goto LABEL20;
  499. X    VW = V2 + V0;
  500. X    FW = MPutBuff(VW);
  501. X    LABEL20:
  502. X    VB = V1 + V0;
  503. X    FB = MGetBuff(VB);
  504. X    if (P1 < P2) goto LABEL21;
  505. X    VW = V2 + V0;
  506. X    FW = MPutBuff(VW);
  507. X    LABEL21:
  508. X    VB = V1 + V0;
  509. X    FB = MGetBuff(VB);
  510. X    if (P2 < P1) goto LABEL22;
  511. X    goto LABEL23;
  512. X    LABEL22:
  513. X    VW = V2 + V0;
  514. X    FW = MPutBuff(VW);
  515. X    LABEL23:
  516. X    VB = V1 + V0;
  517. X    FB = MGetBuff(VB);
  518. X    if (P1 < P1) goto LABEL24;
  519. X    goto LABEL25;
  520. X    LABEL24:
  521. X    VW = V2 + V0;
  522. X    FW = MPutBuff(VW);
  523. X    LABEL25:
  524. X    VB = V1 + V0;
  525. X    FB = MGetBuff(VB);
  526. X    FA = F1;
  527. X    if (FA == F1) goto LABEL26;
  528. X    VW = V2 + V0;
  529. X    FW = MPutBuff(VW);
  530. X    LABEL26:
  531. X    VB = V1 + V0;
  532. X    FB = MGetBuff(VB);
  533. X    VA = (P3 & 0xFF);
  534. X    if (VA == V3) goto LABEL27;
  535. X    VW = V2 + V0;
  536. X    FW = MPutBuff(VW);
  537. X    LABEL27:
  538. X    VB = V1 + V0;
  539. X    FB = MGetBuff(VB);
  540. X    PA = (V2 & 0xFF);
  541. X    if (PA == P2) goto LABEL28;
  542. X    VW = V2 + V0;
  543. X    FW = MPutBuff(VW);
  544. X    LABEL28:
  545. X    VB = V1 + V0;
  546. X    FB = MGetBuff(VB);
  547. X    FA = F1;
  548. X    VA = V2 + V0;
  549. X    PA = (V3 & 0xFF);
  550. X    if (FA == F1) goto LABEL29;
  551. X    VW = V2 + V0;
  552. X    FW = MPutBuff(VW);
  553. X    LABEL29:
  554. X    VB = V1 + V0;
  555. X    FB = MGetBuff(VB);
  556. X    if (VA == V2) goto LABEL30;
  557. X    VW = V2 + V0;
  558. X    FW = MPutBuff(VW);
  559. X    LABEL30:
  560. X    VB = V1 + V0;
  561. X    FB = MGetBuff(VB);
  562. X    FA = F1;
  563. X    PA = P2 + P0;
  564. X    VA = (P3 & 0xFF);
  565. X    if (FA == F1) goto LABEL31;
  566. X    VW = V2 + V0;
  567. X    FW = MPutBuff(VW);
  568. X    LABEL31:
  569. X    VB = V1 + V0;
  570. X    FB = MGetBuff(VB);
  571. X    if (PA == P2) goto LABEL32;
  572. X    VW = V2 + V0;
  573. X    FW = MPutBuff(VW);
  574. X    LABEL32:
  575. X    VB = V1 + V0;
  576. X    FB = MGetBuff(VB);
  577. X    FA = F1;
  578. X    PA = P3 + P0;
  579. X    VA = V2 + V0;
  580. X    FA = F0;
  581. X    if (VA == V2) goto LABEL33;
  582. X    VW = V2 + V0;
  583. X    FW = MPutBuff(VW);
  584. X    LABEL33:
  585. X    VB = V1 + V0;
  586. X    FB = MGetBuff(VB);
  587. X    if (PA == P3) goto LABEL34;
  588. X    VW = V2 + V0;
  589. X    FW = MPutBuff(VW);
  590. X    LABEL34:
  591. X    VB = V1 + V0;
  592. X    FB = MGetBuff(VB);
  593. X    FE = F0;
  594. X    PE = (V0 & 0xFF);
  595. X    VE = V1 + V3;
  596. X    if (VE == V4) goto LABEL35;
  597. X    VW = V2 + V0;
  598. X    FW = MPutBuff(VW);
  599. X    LABEL35:
  600. X    VB = V1 + V0;
  601. X    FB = MGetBuff(VB);
  602. X    if (PE == P0) goto LABEL36;
  603. X    VW = V2 + V0;
  604. X    FW = MPutBuff(VW);
  605. X    LABEL36:
  606. X    VB = V1 + V0;
  607. X    FB = MGetBuff(VB);
  608. X    if (FE == F0) goto LABEL37;
  609. X    VW = V2 + V0;
  610. X    FW = MPutBuff(VW);
  611. X    LABEL37:
  612. X/* END SUBROUTINE S. */
  613. X    return;
  614. X    }
  615. X/* BEGIN SUBROUTINE Q. */
  616. Xvoid SubQ(void);
  617. Xvoid SubQ()
  618. X{
  619. X    VB = V1 + V0;
  620. X    FB = MGetBuff(VB);
  621. X    FA = F0;
  622. X    VA = V0 + V0;
  623. X    PA = P1 + P2;
  624. X    if (FA == F0) goto LABEL41;
  625. X    VW = V2 + V0;
  626. X    FW = MPutBuff(VW);
  627. X    LABEL41:
  628. X    VB = V1 + V0;
  629. X    FB = MGetBuff(VB);
  630. X    if (VA == V0) goto LABEL42;
  631. X    VW = V2 + V0;
  632. X    FW = MPutBuff(VW);
  633. X    LABEL42:
  634. X    VB = V1 + V0;
  635. X    FB = MGetBuff(VB);
  636. X    if (PA == P3) goto LABEL43;
  637. X    VW = V2 + V0;
  638. X    FW = MPutBuff(VW);
  639. X    LABEL43:
  640. X    VB = V1 + V0;
  641. X    FB = MGetBuff(VB);
  642. X    VA = V0 + V0;
  643. X    FA = F0;
  644. X    PA = P1 - P3;
  645. X    if (FA == F0) goto LABEL44;
  646. X    VW = V2 + V0;
  647. X    FW = MPutBuff(VW);
  648. X    LABEL44:
  649. X    VB = V1 + V0;
  650. X    FB = MGetBuff(VB);
  651. X    if (VA == V0) goto LABEL45;
  652. X    VW = V2 + V0;
  653. X    FW = MPutBuff(VW);
  654. X    LABEL45:
  655. X    VB = V1 + V0;
  656. X    FB = MGetBuff(VB);
  657. X    PA = PA + P3;
  658. X    if (PA == P1) goto LABEL46;
  659. X    VW = V2 + V0;
  660. X    FW = MPutBuff(VW);
  661. X    LABEL46:
  662. X    VB = V1 + V0;
  663. X    FB = MGetBuff(VB);
  664. X    PA = P0 + P0;
  665. X    FA = F0;
  666. X    VA = V1 - V3;
  667. X    if (FA == F0) goto LABEL47;
  668. X    VW = V2 + V0;
  669. X    FW = MPutBuff(VW);
  670. X    LABEL47:
  671. X    VB = V1 + V0;
  672. X    FB = MGetBuff(VB);
  673. X    if (PA == P0) goto LABEL48;
  674. X    VW = V2 + V0;
  675. X    FW = MPutBuff(VW);
  676. X    LABEL48:
  677. X    VB = V1 + V0;
  678. X    FB = MGetBuff(VB);
  679. X    VA = VA + V3;
  680. X    if (VA == V1) goto LABEL49;
  681. X    VW = V2 + V0;
  682. X    FW = MPutBuff(VW);
  683. X    LABEL49:
  684. X    VB = V1 + V0;
  685. X    FB = MGetBuff(VB);
  686. X    VA = V0 + V0;
  687. X    FA = F0;
  688. X    PA = P3 * P3;
  689. X    PD = (V9 & 0xFF);
  690. X    if (PA == PD) goto LABEL50;
  691. X    VW = V2 + V0;
  692. X    FW = MPutBuff(VW);
  693. X    LABEL50:
  694. X    VB = V1 + V0;
  695. X    FB = MGetBuff(VB);
  696. X    if (VA == V0) goto LABEL51;
  697. X    VW = V2 + V0;
  698. X    FW = MPutBuff(VW);
  699. X    LABEL51:
  700. X    VB = V1 + V0;
  701. X    FB = MGetBuff(VB);
  702. X    if (FA == F0) goto LABEL52;
  703. X    VW = V2 + V0;
  704. X    FW = MPutBuff(VW);
  705. X    LABEL52:
  706. X    VB = V1 + V0;
  707. X    FB = MGetBuff(VB);
  708. X    VC = V0 + V0;
  709. X    FC = F0;
  710. X    PA = (V6 & 0xFF);
  711. X    PC = PA / P2;
  712. X    if (PC == P3) goto LABEL53;
  713. X    VW = V2 + V0;
  714. X    FW = MPutBuff(VW);
  715. X    LABEL53:
  716. X/* END SUBROUTINE Q. */
  717. X    return;
  718. X    }
  719. X/* BEGIN SUBROUTINE R. */
  720. Xvoid SubR(void);
  721. Xvoid SubR()
  722. X{
  723. X    SubQ();
  724. X    VB = V1 + V0;
  725. X    FB = MGetBuff(VB);
  726. X    if (VC == V0) goto LABEL54;
  727. X    VW = V2 + V0;
  728. X    FW = MPutBuff(VW);
  729. X    LABEL54:
  730. X    VB = V1 + V0;
  731. X    FB = MGetBuff(VB);
  732. X    if (VC == V0) goto LABEL55;
  733. X    VW = V2 + V0;
  734. X    FW = MPutBuff(VW);
  735. X    LABEL55:
  736. X    VB = V1 + V0;
  737. X    FB = MGetBuff(VB);
  738. X    PA = (V7 & 0xFF);
  739. X    PC = PA / P2;
  740. X    if (PC == P3) goto LABEL56;
  741. X    VW = V2 + V0;
  742. X    FW = MPutBuff(VW);
  743. X    LABEL56:
  744. X    VB = V1 + V0;
  745. X    FB = MGetBuff(VB);
  746. X    PA = (V7 & 0xFF);
  747. X    PA = P0 - PA;
  748. X    PC = PA / P2;
  749. X    PC = P0 - PC;
  750. X    if (PC == P3) goto LABEL57;
  751. X    VW = V2 + V0;
  752. X    FW = MPutBuff(VW);
  753. X    LABEL57:
  754. X    VB = V1 + V0;
  755. X    FB = MGetBuff(VB);
  756. X    PA = (V7 & 0xFF);
  757. X    PD = P0 - P2;
  758. X    PC = PA / PD;
  759. X    PC = P0 - PC;
  760. X    if (PC == P3) goto LABEL58;
  761. X    VW = V2 + V0;
  762. X    FW = MPutBuff(VW);
  763. X    LABEL58:
  764. X    VB = V1 + V0;
  765. X    FB = MGetBuff(VB);
  766. X    PA = (V7 & 0xFF);
  767. X    PA = P0 - PA;
  768. X    PD = P0 - P2;
  769. X    PC = PA / PD;
  770. X    if (PC == P3) goto LABEL59;
  771. X    VW = V2 + V0;
  772. X    FW = MPutBuff(VW);
  773. X    LABEL59:
  774. X    VB = V1 + V0;
  775. X    FB = MGetBuff(VB);
  776. X    PD = (V4 & 0xFF);
  777. X    PA = P0 - P2;
  778. X    PC = P2 * PA;
  779. X    PC = P0 - PC;
  780. X    if (PC == PD) goto LABEL60;
  781. X    VW = V2 + V0;
  782. X    FW = MPutBuff(VW);
  783. X    LABEL60:
  784. X    VB = V1 + V0;
  785. X    FB = MGetBuff(VB);
  786. X    PD = (V4 & 0xFF);
  787. X    PA = P0 - P2;
  788. X    PC = PA * P2;
  789. X    PC = P0 - PC;
  790. X    if (PC == PD) goto LABEL61;
  791. X    VW = V2 + V0;
  792. X    FW = MPutBuff(VW);
  793. X    LABEL61:
  794. X    VB = V1 + V0;
  795. X    FB = MGetBuff(VB);
  796. X    PD = (V4 & 0xFF);
  797. X    PA = P0 - P2;
  798. X    PC = PA * PA;
  799. X    if (PC == PD) goto LABEL62;
  800. X    VW = V2 + V0;
  801. X    FW = MPutBuff(VW);
  802. X    LABEL62:
  803. X    VB = V1 + V0;
  804. X    FB = MGetBuff(VB);
  805. X    VC = V0 - V6;
  806. X    if (VC == V6) goto LABEL63;
  807. X    goto LABEL64;
  808. X    LABEL63:
  809. X    VW = V2 + V0;
  810. X    FW = MPutBuff(VW);
  811. X    LABEL64:
  812. X    VB = V1 + V0;
  813. X    FB = MGetBuff(VB);
  814. X    if (VC != V6) goto LABEL65;
  815. X    VW = V2 + V0;
  816. X    FW = MPutBuff(VW);
  817. X    LABEL65:
  818. X    VB = V1 + V0;
  819. X    FB = MGetBuff(VB);
  820. X    PC = P0 - P3;
  821. X    if (PC == P3) goto LABEL66;
  822. X    goto LABEL67;
  823. X    LABEL66:
  824. X    VW = V2 + V0;
  825. X    FW = MPutBuff(VW);
  826. X    LABEL67:
  827. X    VB = V1 + V0;
  828. X    FB = MGetBuff(VB);
  829. X    if (PC != P3) goto LABEL68;
  830. X    VW = V2 + V0;
  831. X    FW = MPutBuff(VW);
  832. X    LABEL68:
  833. X    VB = V1 + V0;
  834. X    FB = MGetBuff(VB);
  835. X    if (PC < P3) goto LABEL69;
  836. X    VW = V2 + V0;
  837. X    FW = MPutBuff(VW);
  838. X    LABEL69:
  839. X    VB = V1 + V0;
  840. X    FB = MGetBuff(VB);
  841. X    if (P3 < PC) goto LABEL70;
  842. X    goto LABEL71;
  843. X    LABEL70:
  844. X    VW = V2 + V0;
  845. X    FW = MPutBuff(VW);
  846. X    LABEL71:
  847. X/* END SUBROUTINE R. */
  848. X    return;
  849. X    }
  850. X/* BEGIN MAIN ROUTINE. */
  851. Xshort DoIt()
  852. X{
  853. X    F0 = 0; F1 = 1; F2 = 2; F3 = 3;
  854. X    V0 = 0; V1 = 1; V2 = 2; V3 = 3; V4 = 4;
  855. X    V5 = 5; V6 = 6; V7 = 7; V8 = 8; V9 = 9;
  856. X    P0 = 0; P1 = 1; P2 = 2; P3 = 3; P4 = 4;
  857. X    P5 = 5; P6 = 10;
  858. X    P8 = ((long) MEM);
  859. X    P9 = ((long) MEM) + sizeof(long) * MEMSIZ;
  860. X    MStartIO(PLargcnt, PLarglist);
  861. X    VB = V1 + V0;
  862. X    FB = MGetBuff(VB);
  863. X    VW = V2 + V0;
  864. X    FW = MPutBuff(VW);
  865. X    VB = V1 + V0;
  866. X    FB = MGetBuff(VB);
  867. X    VW = V2 + V0;
  868. X    FW = MPutBuff(VW);
  869. X    VB = V1 + V0;
  870. X    FB = MGetBuff(VB);
  871. X    VW = V2 + V0;
  872. X    FW = MPutBuff(VW);
  873. X    SubF();
  874. X    VB = V1 + V0;
  875. X    FB = MGetBuff(VB);
  876. X    goto LABEL02;
  877. X    LABEL01:
  878. X    VW = V2 + V0;
  879. X    FW = MPutBuff(VW);
  880. X    LABEL02:
  881. X    SubS();
  882. X    VB = V1 + V0;
  883. X    FB = MGetBuff(VB);
  884. X    VW = V2 + V0;
  885. X    FW = MPutBuff(VW);
  886. X    VB = V1 + V0;
  887. X    FB = MGetBuff(VB);
  888. X    VD = MGetChar();
  889. X    VE = MGetChar();
  890. X    VF = MGetChar();
  891. X    VG = MGetChar();
  892. X    VH = MGetChar();
  893. X    VI = MGetChar();
  894. X    VJ = MGetChar();
  895. X    VB = V1 + V0;
  896. X    FB = MGetBuff(VB);
  897. X    if (VJ == V0) goto LABEL38;
  898. X    VW = V2 + V0;
  899. X    FW = MPutBuff(VW);
  900. X    LABEL38:
  901. X    VD = MPutChar(VD);
  902. X    VE = MPutChar(VE);
  903. X    VF = MPutChar(VF);
  904. X    VI = MPutChar(VI);
  905. X    VH = MPutChar(VH);
  906. X    VH = MPutChar(VH);
  907. X    VG = MPutChar(VG);
  908. X    VJ = MPutChar(VJ);
  909. X    VW = V2 + V0;
  910. X    FW = MPutBuff(VW);
  911. X    VB = V1 + V0;
  912. X    FB = MGetBuff(VB);
  913. X    VW = V2 + V0;
  914. X    FW = MPutBuff(VW);
  915. X    VB = V1 + V0;
  916. X    FB = MGetBuff(VB);
  917. X    VD = MGetChar();
  918. X    VE = MGetChar();
  919. X    VF = MGetChar();
  920. X    VG = MGetChar();
  921. X    VH = MGetChar();
  922. X    VB = V1 + V0;
  923. X    FB = MGetBuff(VB);
  924. X    if (VH == V0) goto LABEL39;
  925. X    VW = V2 + V0;
  926. X    FW = MPutBuff(VW);
  927. X    LABEL39:
  928. X    VD = MPutChar(VD);
  929. X    VE = MPutChar(VE);
  930. X    VF = MPutChar(VF);
  931. X    VJ = VG + V0;
  932. X    VJ = MPutChar(VJ);
  933. X    VF = MPutChar(VF);
  934. X    VJ = VG + V1;
  935. X    VJ = MPutChar(VJ);
  936. X    VF = MPutChar(VF);
  937. X    VJ = VG + V2;
  938. X    VJ = MPutChar(VJ);
  939. X    VF = MPutChar(VF);
  940. X    VJ = VG + V3;
  941. X    VJ = MPutChar(VJ);
  942. X    VF = MPutChar(VF);
  943. X    VJ = VG + V4;
  944. X    VJ = MPutChar(VJ);
  945. X    VF = MPutChar(VF);
  946. X    VJ = VG + V5;
  947. X    VJ = MPutChar(VJ);
  948. X    VF = MPutChar(VF);
  949. X    VJ = VG + V6;
  950. X    VJ = MPutChar(VJ);
  951. X    VF = MPutChar(VF);
  952. X    VJ = VG + V7;
  953. X    VJ = MPutChar(VJ);
  954. X    VF = MPutChar(VF);
  955. X    VJ = VG + V8;
  956. X    VJ = MPutChar(VJ);
  957. X    VF = MPutChar(VF);
  958. X    VJ = VG + V9;
  959. X    VJ = MPutChar(VJ);
  960. X    VF = MPutChar(VF);
  961. X    VH = MPutChar(VH);
  962. X    VW = V2 + V0;
  963. X    FW = MPutBuff(VW);
  964. X    VB = V1 + V0;
  965. X    FB = MGetBuff(VB);
  966. X    VW = V2 + V0;
  967. X    FW = MPutBuff(VW);
  968. X    VB = V1 + V0;
  969. X    FB = MGetBuff(VB);
  970. X    VD = MGetChar();
  971. X    VG = MGetChar();
  972. X    VE = MGetChar();
  973. X    VF = MGetChar();
  974. X    VG = MGetChar();
  975. X    VH = MGetChar();
  976. X    VB = V1 + V0;
  977. X    FB = MGetBuff(VB);
  978. X    if (VH == V0) goto LABEL40;
  979. X    VW = V2 + V0;
  980. X    FW = MPutBuff(VW);
  981. X    LABEL40:
  982. X    VD = MPutChar(VD);
  983. X    VG = MPutChar(VG);
  984. X    VE = MPutChar(VE);
  985. X    VF = MPutChar(VF);
  986. X    VI = (P0 & 0xFF);
  987. X    VJ = VG + VI;
  988. X    VJ = MPutChar(VJ);
  989. X    VF = MPutChar(VF);
  990. X    VI = (P1 & 0xFF);
  991. X    VJ = VG + VI;
  992. X    VJ = MPutChar(VJ);
  993. X    VF = MPutChar(VF);
  994. X    VI = (P2 & 0xFF);
  995. X    VJ = VG + VI;
  996. X    VJ = MPutChar(VJ);
  997. X    VF = MPutChar(VF);
  998. X    VI = (P3 & 0xFF);
  999. X    VJ = VG + VI;
  1000. X    VJ = MPutChar(VJ);
  1001. X    VH = MPutChar(VH);
  1002. X    VW = V2 + V0;
  1003. X    FW = MPutBuff(VW);
  1004. X    SubR();
  1005. X    VB = V1 + V0;
  1006. X    FB = MGetBuff(VB);
  1007. X    VW = V2 + V0;
  1008. X    FW = MPutBuff(VW);
  1009. X/* END MAIN ROUTINE. */
  1010. X    MStopIO();
  1011. X    return 0;
  1012. X    }
  1013. X/* END PROGRAM. */
  1014. X/* End of generated file */
  1015. END_OF_FILE
  1016. if test 13523 -ne `wc -c <'LOME/SCMTestC.out'`; then
  1017.     echo shar: \"'LOME/SCMTestC.out'\" unpacked with wrong size!
  1018. fi
  1019. # end of 'LOME/SCMTestC.out'
  1020. fi
  1021. if test -f 'PPL/PPLAmiga.h' -a "${1}" != "-c" ; then 
  1022.   echo shar: Will not clobber existing file \"'PPL/PPLAmiga.h'\"
  1023. else
  1024. echo shar: Extracting \"'PPL/PPLAmiga.h'\" \(16566 characters\)
  1025. sed "s/^X//" >'PPL/PPLAmiga.h' <<'END_OF_FILE'
  1026. X/*
  1027. X * PPLAmiga.h
  1028. X * Portable Programmer's Library General Host Parameters
  1029. X * Copyright 1988,1990 Darren New.  All Rights Reserved.
  1030. X * Amiga version
  1031. X *
  1032. X * Started 19-Feb-88 DHN
  1033. X * LastMod 05-jan-90 DHN
  1034. X *
  1035. X */
  1036. X
  1037. X#ifndef PPL_h
  1038. X#define PPL_h
  1039. X
  1040. X
  1041. X/*****************************************************************
  1042. X *
  1043. X * This file gets included into every PPL source file.
  1044. X * This one of the few include files that the host programmer
  1045. X * should be changing.
  1046. X *
  1047. X */
  1048. X
  1049. X/*****************************************************************
  1050. X *
  1051. X * Include whatever files you need here to supply
  1052. X *  strlen, strcpy, strncmp, strcmp, strchr
  1053. X *  toupper, tolower
  1054. X *  isalnum, isaplha, isdigit, isupper, islower, isspace
  1055. X *  fault, assert, bomb
  1056. X *
  1057. X *  Note that assert can be compiled out, fault can always return
  1058. X *  false, and bomb can call PLExit(PLsev_bomb).
  1059. X *
  1060. X */
  1061. X
  1062. X#include "exec/types.h"
  1063. X#include "libraries/dos.h"
  1064. X#include "stdlib.h"
  1065. X#include "string.h"
  1066. X#include "ctype.h"
  1067. X
  1068. X#undef TRUE
  1069. X#undef FALSE
  1070. X#undef BITSPERLONG
  1071. X#undef NULL
  1072. X
  1073. X#define USE_ASSERT 1
  1074. X
  1075. X#include "Fault.h"
  1076. X
  1077. X/*****************************************************************
  1078. X *
  1079. X * These parameters describe your C compiler:
  1080. X *
  1081. X */
  1082. X
  1083. X/* First, some raw, low-level information advantage of which should
  1084. X * probably never be taken.
  1085. X */
  1086. X#define BITSPERCHAR    8
  1087. X#define BITSPERSHORT  16
  1088. X#define BITSPERLONG   32
  1089. X#define BITSPERFLOAT  32
  1090. X#define BITSPERDOUBLE 64
  1091. X
  1092. X/* To account for character-set differences, this macro (or function)
  1093. X * must accept a digit and return an integer from 0 to 9.
  1094. X * The other macro goes the other direction.
  1095. X */
  1096. X#define PLToInt(a) (a - '0')
  1097. X#define PLToDig(a) (a + '0')
  1098. X
  1099. X/* Set this to the most efficient small integer value for your compiler.
  1100. X * You may include "register" and "unsigned" without ill effect.
  1101. X * Vars of this type are never passed as parameters and are usually
  1102. X * loop indicies or array subscripts.
  1103. X */
  1104. Xtypedef unsigned short inx;
  1105. X
  1106. X/* Set this to a "generic pointer" (either void * or char *).
  1107. X */
  1108. Xtypedef void * ptr;
  1109. X
  1110. X/* Set this to a "boolean". This is not used for arrays, so faster
  1111. X * over smaller is better. Do not make it "register".
  1112. X */
  1113. Xtypedef short bool;
  1114. X
  1115. X/* Set this to the proper value for your computer.
  1116. X */
  1117. X#ifndef NULL
  1118. X#define NULL ((ptr)0)
  1119. X#endif
  1120. X
  1121. X/* Set this to the size of the longest legal file name under the native
  1122. X * operating system calls.
  1123. X * Note that this MUST be declared as a LONG literal.
  1124. X */
  1125. X#define BIGFNAME 512L
  1126. X
  1127. X/* Set this to the largest piece of contiguous memory that can be
  1128. X * allocated and accessed. I.e., this is the sizeof the largest
  1129. X * character array that PLallocmem can return. E.g., IBM PC = 64K.
  1130. X * This limits PLfillmem, PLallocmem, and other functions that
  1131. X * access large chunks of contiguous memory.
  1132. X * Note that this MUST be declared as a LONG literal.
  1133. X */
  1134. X#define BIGMEM 65530L
  1135. X
  1136. X/* Set this to the largest piece of contiguous I/O request that
  1137. X * can be I/O'ed in one call. E.g., IBM PC = 31K.
  1138. X * Note that this MUST be declared as a LONG literal.
  1139. X */
  1140. X#define BIGIO 32760L
  1141. X
  1142. X/* Set this to the smaller of BIGMEM and BIGIO
  1143. X */
  1144. X#define BIGBUF BIGIO
  1145. X
  1146. X/* Set this to the longest line reasonably returnable by the
  1147. X * line-oriented I/O functions. I.e., this is the size of buffers
  1148. X * allocated for GetLine and so on. This needn't be bigger that about 250.
  1149. X */
  1150. X#define BIGLINE 250
  1151. X
  1152. X/* Set this to 1 if you have structure assignment.
  1153. X * Set this to 0 to use PLmemcpy.
  1154. X * (note that PPL never passes structures by value)
  1155. X */
  1156. X#define STRUCT_ASSIGN 1
  1157. X
  1158. X/* Set this to 1 if you have prototype arguments for external functions.
  1159. X * Set this to 0 to declare functions without prototype arguments.
  1160. X */
  1161. X#define PROTOTYPES 1
  1162. X
  1163. X/* Set this to 1 if you have ANSI-style function definition headings.
  1164. X * Set this to 0 if you have PCC-style    function definition headings.
  1165. X */
  1166. X#define ANSIHEADERS 1
  1167. X
  1168. X/* Set this to 1 if HIDDEN functions need prototype declarations.
  1169. X * Set this to 0 if you don't want them.
  1170. X */
  1171. X#define HIDPROTS 1
  1172. X
  1173. X/* Set this to 1 if you want to check arguments to library functions.
  1174. X * Set this to 0 once your programs are debugged.
  1175. X */
  1176. X#define CHKARGS 1
  1177. X
  1178. X
  1179. X
  1180. X
  1181. X/*****************************************************************
  1182. X *
  1183. X * These parameters are utility macros. Do not change them!
  1184. X *
  1185. X */
  1186. Xtypedef char * str;    /* '\0' terminated string */
  1187. X#define EOS '\0'
  1188. X
  1189. X#define loop while(1)   /* like other langs */
  1190. X
  1191. X#define HIDDEN static    /* hidden objects go away (can be changed to comment for stupid debuggers) */
  1192. X
  1193. X/* Use this macro to assign structures */
  1194. X#if STRUCT_ASSIGN
  1195. X#define SASGN(a, b) (a = b)
  1196. X#else
  1197. X#define SASGN(a, b) PLCopyMem(&a, &b, sizeof(a))
  1198. X#endif
  1199. X
  1200. X/* Use this macro to declare arguments on function declarations */
  1201. X#if PROTOTYPES
  1202. X#define ARGS(a) a
  1203. X#else
  1204. X#define ARGS(a) ()
  1205. X#endif
  1206. X
  1207. X/* Use this macro to define formals of function definitions */
  1208. X#if ANSIHEADERS
  1209. X#define ARGS0() ()
  1210. X#define ARGS1(a,b) (a b)
  1211. X#define ARGS2(a,b,c,d) (a b, c d)
  1212. X#define ARGS3(a,b,c,d,e,f) (a b, c d, e f)
  1213. X#define ARGS4(a,b,c,d,e,f,g,h) (a b, c d, e f, g h)
  1214. X#define ARGS5(a,b,c,d,e,f,g,h,i,j) (a b, c d, e f, g h, i j)
  1215. X#define ARGS6(a,b,c,d,e,f,g,h,i,j,k,l) (a b, c d, e f, g h, i j, k l)
  1216. X#define ARGS7(a,b,c,d,e,f,g,h,i,j,k,l,m,n) (a b, c d, e f, g h, i j, k l, m n)
  1217. X#define ARGS8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (a b, c d, e f, g h, i j, k l, m n, o p)
  1218. X#else
  1219. X#define ARGS0() ()
  1220. X#define ARGS1(a,b) (b)a b;
  1221. X#define ARGS2(a,b,c,d) (b,d)a b; c d;
  1222. X#define ARGS3(a,b,c,d,e,f) (b,d,f)a b;c d;e f;
  1223. X#define ARGS4(a,b,c,d,e,f,g,h) (b,d,f,h)a b;c d;e f;g h;
  1224. X#define ARGS5(a,b,c,d,e,f,g,h,i,j) (b,d,f,h,j)a b;c d;e f;g h;i j;
  1225. X#define ARGS6(a,b,c,d,e,f,g,h,i,j,k,l) (b,d,f,h,j,l)a b;c d;e f;g h;i j;k l;
  1226. X#define ARGS7(a,b,c,d,e,f,g,h,i,j,k,l,m,n) (b,d,f,h,j,l,n)a b;c d;e f;g h;i j;k l;m n;
  1227. X#define ARGS8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (b,d,f,h,j,l,n,p)a b;c d;e f;g h;i j;k l;m n;o p;
  1228. X#endif
  1229. X
  1230. X/* This allows constant paramters passed to a short formal to by typecast
  1231. X * easily. It is kind of like a trailing L on an integer. Use new ANSI
  1232. X * stuff instead.
  1233. X */
  1234. X#define S (short)
  1235. X
  1236. X#define TRUE ((bool) 1)
  1237. X#define FALSE ((bool) 0)
  1238. X
  1239. X
  1240. X/*****************************************************************
  1241. X *
  1242. X * These declare the startup and termination routines.
  1243. X * Do NOT change these!
  1244. X *
  1245. X */
  1246. X
  1247. X/* This is to be called by the main() of the host program.
  1248. X * It returns the exit severity.
  1249. X */
  1250. Xextern short DoIt ARGS((void));
  1251. X
  1252. X/* This is called by the application when an unrecoverable error
  1253. X * has occured. The severity is passed as the argument.
  1254. X * The host should clean up if possible.
  1255. X */
  1256. Xextern void PLExit ARGS((short severity));
  1257. X
  1258. X/* These are the severities:
  1259. X */
  1260. X#define PLsev_normal    0   /* no error - just exit normally */
  1261. X#define PLsev_badarg    1   /* command line arguments bad or wrong config */
  1262. X#define PLsev_error    2   /* some other kind of error */
  1263. X#define PLsev_userbreak 3   /* user requested unclean interrupt */
  1264. X#define PLsev_oores    4   /* out of required resource */
  1265. X#define PLsev_nfres    5   /* required resource not found at all */
  1266. X#define PLsev_badform    6   /* input or file in wrong format */
  1267. X#define PLsev_fault    7   /* user req to not recov from recov error */
  1268. X#define PLsev_bomb    8   /* program detected unrecov error */
  1269. X#define PLsev_assert    9   /* assertion failed */
  1270. X#define PLsev_crash    10  /* program (and probably machine) crashed */
  1271. X
  1272. X
  1273. X/*****************************************************************
  1274. X *
  1275. X * These declare the memory allocation / access primatives
  1276. X *
  1277. X */
  1278. X
  1279. X/* This allocates dynamic memory. The first argument is a LONG
  1280. X * specifying how much memory (in bytes) needs to be allocated.
  1281. X * The second is an INT containing various flags (two so far).
  1282. X * If (flags & PLalloc_die) this will bomb("Out of Memory")
  1283. X * if the allocation fails; otherwise it will return NULL if the
  1284. X * allocation fails.
  1285. X * You will fail the allocation or bomb("Memory request too large")
  1286. X * if more memory than BIGMEM is requested. This retains the length
  1287. X * for the PLfreemem function.
  1288. X * If (flags & PLalloc_zero) this will clear the allocated memory to
  1289. X * all binary zeros if the allocation succeeds; otherwise, the memory
  1290. X * will be uninitialized.
  1291. X */
  1292. X#define PLalloc_die  1    /* bomb if out of memory */
  1293. X#define PLalloc_zero 2    /* clear new mem to zeros */
  1294. Xptr PLAllocMem ARGS((long size, int flags));
  1295. X
  1296. X/* This frees dynamic memory. The argument is a previously-allocated
  1297. X * pointer to memory as returned by PLAllocMem(). The application is
  1298. X * responsible for deallocating all memory it allocates before returning
  1299. X * normally from DoIt(). If possible, the application should deallocate
  1300. X * all memory before calling PLExit. The host programmer may wish to
  1301. X * check that memory is freed exactly once.
  1302. X */
  1303. Xvoid PLFreeMem ARGS((ptr where));
  1304. X
  1305. X/* This allocates enough memory to hold the given string, then copies
  1306. X * the string into that memory. It passes PLalloc_die=true to the
  1307. X * PLallocmem call.
  1308. X */
  1309. Xstr PLStrDup ARGS((str s));
  1310. X
  1311. X/* This copies memory from src to dest for siz bytes. The host function
  1312. X * will handle copying in the correct direction if the areas overlap.
  1313. X * This should be as efficient as possible.
  1314. X */
  1315. Xvoid PLCopyMem ARGS((ptr to, ptr from, long siz));
  1316. X
  1317. X/* This assigns a constant byte to a region of memory.
  1318. X * Again, this should be as efficient as possible.
  1319. X */
  1320. Xvoid PLFillMem ARGS((ptr where, long siz, char chr));
  1321. X
  1322. X/* This looks for a specific character within a range of memory.
  1323. X * It returns NULL if not found, or a pointer to the matching character
  1324. X * if found.
  1325. X */
  1326. Xptr PLFindMem ARGS((ptr where, long siz, char chr));
  1327. X
  1328. X
  1329. X/*****************************************************************
  1330. X *
  1331. X * These declare the error routines
  1332. X *
  1333. X */
  1334. X
  1335. X/* This is the type of an error value
  1336. X */
  1337. Xtypedef short PLerr_enum;
  1338. X#define PLerr_none    0   /* no error occured */
  1339. X#define PLerr_opsysR    1   /* otherwise unknown error - retry */
  1340. X#define PLerr_opsysW    2   /* otherwise unknown error - wait then retry */
  1341. X#define PLerr_opsysU    3   /* otherwise unknown error - ask user to fix */
  1342. X#define PLerr_opsysF    4   /* otherwise unknown error - unrecoverable failure */
  1343. X#define PLerr_fault    5   /* program-detected error */
  1344. X#define PLerr_eod    6   /* end of data (during read) */
  1345. X#define PLerr_oores    7   /* out of some resource (during write/create) */
  1346. X#define PLerr_again    8   /* multiple errors occured without being cleared */
  1347. X#define PLerr_exist    9   /* access to non-existant item */
  1348. X#define PLerr_already    10  /* can't create because item already there */
  1349. X#define PLerr_permit    11  /* "owner" disallows that access to you */
  1350. X#define PLerr_unsup    12  /* unsuported in this instance */
  1351. X#define PLerr_busy    13  /* item exits but is busy */
  1352. X#define PLerr_param    14  /* argument to function cannot be parsed */
  1353. X#define PLerr_notyet    15  /* something not yet implemented */
  1354. X#define PLerr_never    16  /* something that cannot be implemented */
  1355. X#define PLerr_badarg    17  /* argument to function semantically invalid */
  1356. X#define PLerr_overflow    18  /* overflow error */
  1357. X#define PLerr_underflow 19  /* underflow error */
  1358. X#define PLerr_userbreak 20  /* user break or interrupted system call */
  1359. X#define PLerr_last    21  /* largest error number + 1 */
  1360. X
  1361. X/* The PL error number */
  1362. Xextern PLerr_enum PLerr;
  1363. X
  1364. X/* The OS error number (whatever you need, if anything) */
  1365. Xextern int OSerr;   /* may be changed by HostPgrmr */
  1366. X
  1367. X/* The file and line of the last error (mainly for debugging) */
  1368. Xextern str PLerr_file;
  1369. Xextern long PLerr_line;
  1370. X
  1371. X/* This sets the error number.
  1372. X */
  1373. X#ifdef DEBUG
  1374. X#define PLErrSet(e) ((PLerr_file=__FILE__),(PLerr_line=__LINE__),\
  1375. XPLerr=((PLerr!=PLerr_none)?PLerr_again:(e)))
  1376. X#else
  1377. X#define PLErrSet(e) (PLerr = ((PLerr != PLerr_none) ? PLerr_again : (e)))
  1378. X#endif
  1379. X
  1380. X/* This clears the error number.
  1381. X * (This may be a void function if your compiler doesn't like empty args)
  1382. X */
  1383. X#define PLErrClr() (OSerr=0,PLerr=PLerr_none)
  1384. X
  1385. X/* This returns a string, suitable for user viewing, describing the
  1386. X * most recent error as indicated by PLerr.
  1387. X * The string should be static.
  1388. X */
  1389. Xstr PLErrText ARGS((void));
  1390. X
  1391. X/* This returns a string, suitable for user viewing, describing the
  1392. X * most recent error in the HOST terminology. Used when PLopsys?
  1393. X * returned or for additional information.
  1394. X * The string should be static.
  1395. X */
  1396. Xstr PLOSErrText ARGS((void));
  1397. X
  1398. X/*****************************************************************
  1399. X *
  1400. X * These declare the status message routines
  1401. X *   (Note that delay and beep are included here only due to their
  1402. X *    typical usage.)
  1403. X *
  1404. X */
  1405. X
  1406. X/* This displays a status message for utilities. The display should
  1407. X * be suppressed if PLstatuslevel <= level. PLstatuslevel should be
  1408. X * initialized before calling DoIt(), and is intended to be
  1409. X * changable by the user. It should default to a value of 6 (giving
  1410. X * status messages in the range 0-6).
  1411. X * level == 5 should be used for normal status messages, including
  1412. X * initial copyright messages, final summaries, and so on;
  1413. X * level == 6 should be used for progress reports;
  1414. X * level == 7 should be used to echo parameters; level == 3 should be
  1415. X * use for warnings and level == 2 should be used for non-fatal errors.
  1416. X * Obviously, use level == 0 (which can't be disabled) for fatal errors.
  1417. X */
  1418. Xextern short PLstatuslevel;
  1419. Xvoid PLStatus ARGS((short level, str message));
  1420. X
  1421. X/* This function will delay for the indicated number of seconds in the
  1422. X * most efficient way possible. (Of course, on a single-tasking
  1423. X * machine, you may wait as inefficiently as you like.)
  1424. X */
  1425. Xextern void PLDelay ARGS((short secs));
  1426. X
  1427. X/* This function is used to draw the user's attention to the computer.
  1428. X * If passed a zero, it should make a quiet, pleasant beep or chime,
  1429. X * or simply flash the screen if possible. This option will be used
  1430. X * to indicate that a minor error (like an illegal keystroke) has
  1431. X * occured.
  1432. X * If passed a one, it should make an audible tone, loud enough to be
  1433. X * heard even if not listened for. This should be used to indicate that
  1434. X * a lengthy process (during which the user has started working on
  1435. X * back paperwork or something) has completed. It should never be used
  1436. X * to indicate that an error has occured.
  1437. X * If passed a two or greater, it should give a rude audible indicator
  1438. X * of problems. This will be used only when the user is about to do
  1439. X * something that it is quite unlikely he wants to do.
  1440. X */
  1441. Xextern void PLBeep ARGS((short how));
  1442. X
  1443. X
  1444. X/*****************************************************************
  1445. X *
  1446. X * These declare basic standard input/output functions
  1447. X *
  1448. X * Do not use these in sophisticated applications.
  1449. X * Do not use these in place of the PLstatus routine.
  1450. X */
  1451. X
  1452. X
  1453. X/* This should return an integer from 0 to 255, representing the ASCII
  1454. X * of the next character read from the "standard input" or -1 for EOF or
  1455. X * -2 for some other I/O error. Newline must be returned as '\n', and
  1456. X * space as ' ' and tab as '\t'. It is assumed that redirection might
  1457. X * occur on this stream -- see also PLresetinput().
  1458. X * This may be changed to a macro by the host programmer.
  1459. X */
  1460. Xshort PLGetChar ARGS((void));
  1461. X
  1462. X/* This should send the indicated character to the "standard output".
  1463. X * The output characters may include '\n' for newline. It is assumed
  1464. X * that redirection may occur on this stream -- see also PLresetoutput().
  1465. X * This may be changed to a macro by the host programmer.
  1466. X */
  1467. Xvoid PLPutChar ARGS((short ch));
  1468. X
  1469. X/* When this is called, further calls to PLgetchar() should take
  1470. X * their input from the user terminal.
  1471. X * This may be changed to a macro by the host programmer.
  1472. X */
  1473. Xvoid PLResetInput ARGS((void));
  1474. X
  1475. X/* When this is called, further calls to PLputchar() should send
  1476. X * their output to the user terminal.
  1477. X * This may be changed to a macro by the host programmer.
  1478. X */
  1479. Xvoid PLResetOutput ARGS((void));
  1480. X
  1481. X    /* For testing only! Do not call printf except while debugging! */
  1482. X    extern void printf(char *, ...);
  1483. X
  1484. X
  1485. X/*****************************************************************
  1486. X *
  1487. X * These declare command-line argument functions
  1488. X *
  1489. X */
  1490. X
  1491. X/* This gives the name of the executable file, if available.
  1492. X * Otherwise, this will be NULL.
  1493. X */
  1494. Xextern str PLcmdname;
  1495. X
  1496. X/* This gives the host-syntax filename for the executable file now running,
  1497. X * if available.
  1498. X * Otherwise, this will be NULL.
  1499. X */
  1500. Xextern str PLcmdfile;
  1501. X
  1502. X/* This tells how many command-line arguments there were, EXCLUDING
  1503. X * the command name.
  1504. X */
  1505. Xextern short PLargcnt;
  1506. X
  1507. X/* This is the array of command-line argument strings, EXCLUDING the
  1508. X * command name.
  1509. X */
  1510. Xextern str PLarglist[];
  1511. X
  1512. X/* These are the flags describing the command-line parameters.
  1513. X */
  1514. Xextern long PLargflags;
  1515. X#define PLaf_hostwc 1    /* use host wildcards instead of portable wc's */
  1516. X#define PLaf_hostex 2    /* host already has expanded wildcards */
  1517. X
  1518. X
  1519. X
  1520. X#endif /* PPL_h */
  1521. X
  1522. END_OF_FILE
  1523. if test 16566 -ne `wc -c <'PPL/PPLAmiga.h'`; then
  1524.     echo shar: \"'PPL/PPLAmiga.h'\" unpacked with wrong size!
  1525. fi
  1526. # end of 'PPL/PPLAmiga.h'
  1527. fi
  1528. echo shar: End of archive 7 \(of 9\).
  1529. cp /dev/null ark7isdone
  1530. MISSING=""
  1531. for I in 1 2 3 4 5 6 7 8 9 ; do
  1532.     if test ! -f ark${I}isdone ; then
  1533.     MISSING="${MISSING} ${I}"
  1534.     fi
  1535. done
  1536. if test "${MISSING}" = "" ; then
  1537.     echo You have unpacked all 9 archives.
  1538.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1539. else
  1540.     echo You still need to unpack the following archives:
  1541.     echo "        " ${MISSING}
  1542. fi
  1543. ##  End of shell archive.
  1544. exit 0
  1545. -- 
  1546. --- Darren New --- Grad Student --- CIS --- Univ. of Delaware ---
  1547.  
  1548. exit 0 # Just in case...
  1549. -- 
  1550. Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
  1551. Use a domain-based address or give alternate paths, or you may lose out.
  1552.