THE IMP INTERMEDIATE CODE The IMP Intermediate Code may be considered the order-code of a stack-oriented machine which manipulates objects exclusively through descriptors. The code is made up from ASCII characters (See Appendix 2 for a complete list of valid characters). Note that the symbols 'SPACE' and 'NEWLINE' are not valid characters; their inclusion in the examples is purely for ease of reading, they do not occur in the actual code. The workspace for this machine comprises three areas: 1. Descriptor Area This is used to hold all descriptors which are currently defined. 2. Parameter Area This is used to hold the descriptors for procedure (formal) parameters and record format elements. 3. Stack This is used to hold copies of descriptors which are being processed. Note that in general these copies are removed whenever they are accessed. The code is input by a program which "simulates" the operations specified and thereby generates code for the target machine. The code is not intended to be interpreted. It is important to note that the intermediate code is a set of commands to a code-generator and that the operations described are compile-time operations. This means that, for example, the operation '@' (q.v.) cannot be used to stack a descriptor as the result of a condition. Hence the ALGOL statement: A := if B=C then D else E could not be encoded as: @a @b @c ? #1 @d F2 :1 @e :2 S NOTATION [V] - The descriptor for the entity with name V. @V - Stack the descriptor for V. Unless otherwise stated all numerical constants in the intermediate code are in octal. 1