.CH "Operators Useful in the Procedure Definition Stream" .ti .op "PROC_DEFN_OP 50" int 50 int object_id int number_of_args string proc_name tree argument_list tree code .bd Each procedure to be generated by the code generator is defined by a PROC_DEFN_OP. The 'object_id' is an integer identifier that must be used on calls to the procedure and other references to its entry control block (for example, pointers to functions as used in C). 'Number_of_args' should be self-explanatory. 'Proc_name' is a string (in the IMF, a length followed by ASCII character values) giving the internal name of the procedure. (This information is used to print trace information during debugging.) Each formal parameter (argument) is described by a PROC_DEFN_ARG_OP; 'argument_list' is simply a linked list of those descriptions. 'Code' is a subtree containing the body of the procedure: local variable definitions and expressions to be evaluated. .bx Example: the following C function main (argc, argv) int argc; char **argv; { int i; i = 4; } 50 PROC_DEFN_OP 1 Procedure is object number 1 2 Procedure has 2 arguments 4 Procedure name is 4 characters long 237 m 225 a 233 i 238 n 49 PROC_DEFN_ARG_OP 2 Argument is object number 2 1 INT_MODE 0 VAL_DISP; pass argument by value 1 Argument is 1 word long 49 PROC_DEFN_ARG_OP 3 Argument is object number 3 4 LONG_UNS_MODE (a pointer) 1 REF_DISP; pass argument by reference 2 Argument is 2 words long 39 NULL_OP; end of argument description list 59 SEQ_OP; beginning of procedure code 13 DEFINE_DYNM_OP 4 Object id is 4 39 NULL_OP; no initializers 1 Object is 1 word long 59 SEQ_OP; procedure code continues 5 ASSIGN_OP 1 INT_MODE 40 OBJECT_OP 1 INT_MODE 4 Object id is 4 9 CONST_OP 1 INT_MODE 1 Constant is 1 word long 4 Constant has value 4 1 Assignment transfers 1 word 39 NULL_OP; end of procedure code .ex .op "PROC_DEFN_ARG_OP 49" int 49 int object_id int mode int disposition int length tree next_argument .bd Formal parameters to procedures are described by this operator. The 'object_id' is an integer identifier that must be supplied on subsequent references to the parameter (see OBJECT_OP). The 'mode' is the machine data type of the parameter. 'Disposition' indicates how the argument is to be treated on the call; the two alternatives at the moment are 0 (VALUE_DISP) for pass-by-value (aka copy in) and 1 (REF_DISP) for pass-by-reference. 'Length' gives the size of the argument in 16-bit words; it is primarily necessary for handling of STOWED arguments that are passed by value. 'Next_argument' is simply a link to the next PROC_DEFN_ARG_OP in a procedure's argument descriptor list, or a NULL_OP. .bx See PROC_DEFN_OP for examples of PROC_DEFN_ARG_OP. .ex .EV .fo //- # -//