*line 1: Unknown output type = >$A invert=0; cap=0; capsh=0; und=0; undsh=0 A P M I M P P R O G R A M M E R ' S G U I D E This manual describes the implementation of the IMP programming language for the APM and includes a description of the main library modules which are available to the programmer. Definition of Language ______________________ The IMP language as implemented on the APM is the agreed version for forward development on the VAX/VMS and M68000 systems. It is substantially as defined in the EUCSD Report "The IMP77 Language" (3rd Edition), with the following exceptions. Discarded features: . non-decimal constants expressed in IBM style (X'...') . %name %function as alternative to %map . loops with a control clause after as well as before (ie an %until as well as a %while or %for) Modified features: . the declaration of %arrayname parameters requires the specification of bounds either as literals or as declared local variables, as illustrated in the following examples: %integerarrayname a(1:1000) %realarrayname delta(10:20,1:30) %bytearrayname used(1:%integer xdim,1:%integer ydim) %shortarrayname count(%byte lo:%byte hi) in order to match the formal parameter, an actual array must have been declared with at least as many dimensions and with identical literals where the formal has literals. Added features . there are a number of additions which make it possible to exercise greater control over the way in which variables are allocated and parameters are passed; these are not of general utility and are not described here. Variant implementation . the effect of %continue is to pass control to the head of the containing loop, where any %while or %for control clause is tested; any %until clause at the end of the loop is ignored. Implementation restrictions ___________________________ The range of integers handled is the 32-bit signed twos-complement range. Apart from type-checking, the declaration %longinteger is treated as equivalent to %integer. Both signed and unsigned (%short and %half) 16-bit integers are supported, the former slightly more efficiently. Both signed and unsigned (%mite and %byte) 8-bit integers are supported, the former slightly more efficiently. In the present implementation, floating-point numbers are limited to 32-bits and the operations on them are implemented by software. Apart from type-checking, the declaration %longreal has the same effect as %real The maximum number of nested textual levels permitted is eight. In this respect, no distinction is made between procedures and %begin/%end blocks. The maximum number of nested conditionals or loops is fifteen. A strict rule of ordering between the declarations and instructions in a block is not imposed, but the following restrictions apply: No declarations are permitted within conditionals or loops; Only static declarations (%const, %own, %external and procedures) are permitted to follow instructions which include a forward jump or procedure call; The specifications for %external procedures and data objects must appear in the outermost level or main %begin/%end block. Features of IMP77 which are not valid in IMP80 (EMAS IMP) and conversely, or which are peculiar to this implementation, are reported as 'non-standard' (warning only). However, this warning is not produced for the following widely used IMP77 facilities, even though they are not available in IMP80: %shortintegers, %predicates, %else %if, operator mod-sign, initialisation of dynamic variables to literal values (but initialisation to non-literal values is flagged). ! ! produce listing to specified file (extension LIS) -LIST produce listing to file with same name as source and extension LIS -LIST produce listing to network printer -NOLIST do not produce listing -LOG output statistics indicating number of statements, atoms per statement, identifiers per statement, time taken, etc. Default: -NOLIST-NOLOG Object program control: -OBJ produce object file with same name as source and extension MOB -OBJ= produce object file with specified name (default extension MOB) -NOOBJ do not produce object file Default: -OBJ (but only if no errors reported) Run-time checks: ? -ASS include unassigned check on full integers ? -STRASS include unassigned check on strings ? -SASS include unassigned check on shorts ? -BASS include unassigned check on bytes ? -ARR include array bound checking * -LOOP include %for loop check * -OVER include overflow check * -CAP include capacity checking Default: -ASS-STRASS-NOSASS-NOBASS-ARR-LOOP-OVER-CAP -NOCHECK has the effect of suppressing all checks Run-time diagnostics: -DIAG include line-number updating for diagnostics -TRACE generate code which allows the program to be executed one line at a time under the control of the Software Front Panel Default: -NODIAG-NOTRACE !> ! !> ! !> ! !> ! !