📄 pumana.n
字号:
Notes on the listings.PPThe first page of a listingincludes a banner line indicating the version and date of generation of.PIor.PC .It alsoincludes the.UXpath name supplied for the source file and the date oflast modification of that file..PPWithin the body of the listing, lines are numbered consecutively andcorrespond to the line numbers for the editor.Currently, two specialkinds of lines may be used to format the listing:a line consisting of a form-feedcharacter, control-l, which causes a pageeject in the listing, and a line withno characters which causes the line number to be suppressed in the listing,creating a truly blank line.These lines thus correspond to `eject' and `space' macros found in manyassemblers.Non-printing characters are printed as the character `?' in the listing.\*(dg.FS\*(dgThe character generated by a control-i indentsto the next `tab stop'.Tab stops are set every 8 columns in.UX .Tabs thus provide a quick way of indenting in the program..FE.SHThe standard procedure write.PPIf no minimum field length parameter is specifiedfor a.I write,the following defaultvalues are assumed:.KS.TScenter;l n.integer 10real 22Boolean length of `true' or `false'char 1string length of the stringoct 11hex 8.TE.KEThe end of each line in a text file should be explicitlyindicated by `writeln(f)', where `writeln(output)' may be writtensimply as `writeln'.For.UX ,the built-in function `page(f)' puts a single.SM ASCIIform-feed character on the output file.For programs which are to be transported the filter.I pcccan be used to interpret carriage control, as.UXdoes not normally do so..NH 2Restrictions and limitations.SHFiles.PPFiles cannot be members of files or members of dynamicallyallocated structures..SHArrays, sets and strings.PPThe calculations involving array subscripts and set elementsare done with 16 bit arithmetic.Thisrestricts the types over which arrays and sets may be defined.The lower bound of such a range must be greater than or equal to\-32768, and the upper bound less than 32768.In particular, strings may have any length from 1 to 65535 characters,and sets may contain no more than 65535 elements..SHLine and symbol length.PPThere is no intrinsic limit on the length of identifiers.Identifiersare considered to be distinct if they differin any single position over their entire length.There is a limit, however, on the maximum inputline length.This limit is quite generous however, currently exceeding 160characters..SHProcedure and function nesting and program size.PPAt most 20 levels of .B procedure and .B function nesting are allowed.There is no fundamental, translator defined limit on the size of theprogram which can be translated.The ultimate limit is supplied by thehardware and thus, on the \s-2PDP\s0-11,by the 16 bit address space.Ifone runs up against the `ran out of memory' diagnostic the program may yettranslate if smaller procedures are used, as a lot of space is freedby the translator at the completion of each .B procedureor.B functionin the currentimplementation..PPOn the \s-2VAX\s0-11, there is an implementation defined limitof 65536 bytes per variable.There is no limit on the number of variables..SHOverflow.PPThere is currently no checking for overflow on arithmetic operations atrun-time on the \s-2PDP\s0-11.Overflow checking is performed on the \s-2VAX\s0-11 by the hardware..br.ne 15.NH 2Added types, operators, procedures and functions.SHAdditional predefined types.PPThe type.I alfais predefined as:.LS\*btype\fP alfa = \*bpacked\fP \*barray\fP [ 1..10 ] \*bof\fP \*bchar\fP.LE.PPThe type.I intsetis predefined as:.LS\*btype\fP intset = \*bset of\fP 0..127.LEIn most cases the context of an expression involving a constantset allows the translator to determine the type of the set, even though theconstant set itself may not uniquely determine this type.In thecases where it is not possible to determine the type of the set fromlocal context, the expression type defaults to a set over the entire basetype unless the base type is integer\*(dg..FS\*(dgThe current translator makes a special case of the construct`if ... in [ ... ]' and enforces only the more lax restrictionon 16 bit arithmetic given above in this case..FEIn the latter case the type defaults to the currentbinding of.I intset,which must be ``type set of (a subrange of) integer'' at that point..PPNote that if .I intset is redefined via:.LS\*btype\fP intset = \*bset of\fP 0..58;.LEthen the default integer set is the implicit.I intset ofPascal 6000\-3.4.SHAdditional predefined operators.PPThe relationals `<' and `>' of proper setinclusion are available.With.I aand.I bsets, note that.LS(\*bnot\fR (\fIa\fR < \fIb\fR)) <> (\fIa\fR >= \fIb\fR).LEAs an example consider the sets.I a= [0,2]and.I b= [1].The only relation true between these sets is `<>'..SHNon-standard procedures.IP argv(i,a) 25where.I i is an integer and.I ais a string variableassigns the (possibly truncated or blank padded).I i \|'thargumentof the invocation of the current.UXprocess to the variable.I a .The range of valid.I iis.I 0to.I argc\-1 ..IP date(a) assigns the current date to the alfa variable .I ain the format `dd mmm yy ', where `mmm' is the firstthree characters of the month, i.e. `Apr'..IP flush(f) writes the output buffered for Pascal file.I finto the associated.UXfile..IP halt terminates the execution of the program witha control flow backtrace..IP linelimit(f,x)\*(dd.FS\*(ddCurrently ignored by pdp-11.X ..FEwith.I f a textfile and.I x an integer expressioncausesthe program to be abnormally terminated if more than.I x lines arewritten on file.I f .If.I x is less than 0 then no limit is imposed..IP message(x,...) causes the parameters, which have the format of thoseto thebuilt-in.B procedure.I write,to be written unbuffered on the diagnostic unit 2,almost always the user's terminal..IP nulla procedure of no arguments which does absolutely nothing.It is useful as a place holder,and is generated by.XPin place of the invisible empty statement..IP remove(a) where.I a is a string causes the.UXfile whosename is.I a, with trailing blanks eliminated, to be removed..IP reset(f,a) where.I a is a string causes the file whose nameis.I a (with blanks trimmed) to be associated with.I f in additionto the normal function of.I reset..IP rewrite(f,a) is analogous to `reset' above..IP stlimit(i)where.I i is an integer sets the statement limit to be.I i statements.Specifying the.B poption to.I pcdisables statement limit counting..IP time(a) causes the current time in the form `\ hh:mm:ss\ ' to beassigned to the alfa variable.I a..SHNon-standard functions.IP argc 25returns the count of arguments when the Pascal programwas invoked..I Argcis always at least 1..IP card(x) returns the cardinality of the set.I x, i.e. thenumber of elements contained in the set..IP clock returns an integer which is the number of central processormilliseconds of user time used by this process..IP expo(x) yields the integer valued exponent of the floating-pointrepresentation of.I x ;expo(\fIx\fP) = entier(log2(abs(\fIx\fP)))..IP random(x) where.I x is a real parameter, evaluated but otherwiseignored, invokes a linear congruential random number generator.Successive seeds are generated as (seed*a + c) mod m andthe new random number is a normalization of the seed to the range 0.0 to 1.0;a is 62605, c is 113218009, and m is536870912.The initial seedis 7774755..IP seed(i) where.I i is an integer sets the random number generator seedto.I i and returns the previous seed.Thus seed(seed(i))has no effect except to yield value.I i..IP sysclockan integer function of no arguments returns the number of central processormilliseconds of system time used by this process..IP undefined(x) a Boolean function.Its argument is a real number andit always returns false..IP wallclock an integer function of no arguments returns the timein seconds since 00:00:00 GMT January 1, 1970..NH 2Remarks on standard and portable Pascal.PPIt is occasionally desirable to prepare Pascal programs which will beacceptable at other Pascal installations.While certain system dependencies are bound to creep in,judicious design and programming practice can usually eliminatemost of the non-portable usages.Wirth's.I "Pascal Report"concludes with a standard for implementation and program exchange..PPIn particular, the following differences may cause trouble when attemptingto transport programs between this implementation and Pascal 6000\-3.4.Using the.B stranslator option may serve to indicate many problem areas.\*(dg.FS\*(dgThe.B soption does not, however, check that identifiers differin the first 8 characters..I Piand.PCalso do not check the semantics of.B packed ..FE.SHFeatures not available in Berkeley Pascal.IPSegmented files and associated functions and procedures..IPThe function.I trunc with two arguments..IPArrays whose indices exceed the capacity of 16 bit arithmetic..SHFeatures available in Berkeley Pascal but not in Pascal 6000-3.4.IPThe procedures.I reset and.I rewrite with file names..IPThe functions.I argc,.I seed,.I sysclock,and.I wallclock..IPThe procedures.I argv,.I flush,and.I remove..IP.I Messagewith arguments other than character strings..IP.I Writewith keyword.B hex ..IPThe.B assertstatement..IPReading and writing of enumerated types..IPAllowing functions to return structures..IPSeparate compilation of programs..IPComparison of records..SHOther problem areas.PPSets and strings are more general in \*.UP ;see the restrictions given inthe Jensen-Wirth.I "User Manual"for details on the 6000\-3.4 restrictions..PPThe character set differences may cause problems,especially the use of the function.I chr,characters as arguments to.I ord,and comparisons of characters,since the character set orderingdiffers between the two machines..PPThe Pascal 6000\-3.4 compiler uses a less strict notion of type equivalence.In.UP ,types are considered identical only if they are representedby the same type identifier.Thus, in particular, unnamed types are uniqueto the variables/fields declared with them..PPPascal 6000\-3.4 doesn't recognize our optionflags, so it is wise toput the control of.UPoptions to the end of option lists or, betteryet, restrict the option list length to one..PPFor Pascal 6000\-3.4 the ordering of files in the program statement hassignificance.It is desirable to place.I input and.I output as the first two files in the.B programstatement..sp 2.SHAcknowledgments.PPThe financial support of William Joy and Susan Graham bythe National Science Foundation under grantsMCS74-07644-A04, MCS78-07291, and MCS80-05144,and the William Joy by an.SM IBMGraduate Fellowship are gratefully acknowledged.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -