.pg .x procedure .x begin .x end .lt ------------------------------------------------------------------------ PROCEDURE procedure-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 a procedure. .b If ^&psect-name\& is specified, then the ^&psect-name\& appended to the string "_local" will be the .PSECT name, otherwise, the procedure name appended with the string "_code" will be the .PSECT name. .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 If _<^®ister-list\&_> is not specified, _<_> is assumed. .b The BEGIN macro separates the data portion of a procedure from the code portion. .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 and, therefore, a MOVL instruction would be generated. .b The RETURN macro will generated a RSB instruction. .b The END macro is used to end the procedure. For every PROCEDURE macro specified, an END MACRO must also be specified. If this is the last procedure in the assembly, the .END instruction can be specified instead of the END macro. .b Specifying the name of the procedure later in your program will generate one of the following instructions: .b .lt bsb procedure-name ; if branch proc=byte bsw procedure-name ; if branch proc=word jsr procedure-name ; if branch proc=long .el .b The default branch displacement type for PROCEDURE is WORD (see BRANCH). .b See also EXTERNAL PROCEDURE, FORWARD PROCEDURE, and GLOBAL PROCEDURE.