.pg .x module .x begin .x end .lt ------------------------------------------------------------------------ MODULE module-name - [PSECT=psect-name] MASK= CONST constants VAR variables BEGIN EXIT [value] [TYPE=type] RETURN END ------------------------------------------------------------------------ .el .b 3 This macro sets up the environment for an interal module. .b If ^&psect-name\& is specified, then the string "_local" will be appended to the ^&psect-name\& and will be the .PSECT name, otherwise, the name of the module appended to the string "_local" will be the .PSECT name. .b If _<^&argument-list\&_> is specified, each argument in the list will be appended to the module name and each resultant string is used in a constant assignment, assigning each with it's offset value from AP. The string ".narg" appended to the module name is always assigned the value of 0 and represents the number of arguments passed to this module. .b If no arguments are specified in _<^&argument-list\&_>, then _<_> must be specified as a place holder for the _<^&argument-list\&_>. .b If _<^®ister-list\&_> is not specified, _<_> is assumed. .b The CONST macro and the VAR macro generate no code and are optional and can be specified as often as required for documentation purposes. .b The BEGIN macro separates the data portion of a module from the code portion. The BEGIN macro must be specified. .b The EXIT macro will generate a $EXIT__S r0 instruction. If value is specified, the value will be moved to r0 before the $EXIT__S intruction is generated. If ^&type\& is not specified, L is assumed. .b The RETURN macro will generated a RET instruction. .b The END macro is used to end the module. For every MODULE macro specified, an END macro must also be specified. If this is the last module in the assembly, an .END instruction can be specified instead of the END macro. .b For example: .b .lt module name var save: .blkw 1 begin movl r0,save statements-1 movl save,r0 return end .el .b See also EXTERNAL MODULE, FORWARD MODULE and GLOBAL MODULE.