Chapter 12
Procedures
A procedure is a set of instructions that perform a specific task. They are invoked from another procedure — the calling procedure (or program) — and provide results to the calling program at the end of execution. Procedures (also called subroutines) are utilized primarily for routines that are called frequently by other procedures. The procedure routine is written only once, but used repeatedly; thereby, saving storage space. Procedures permit a program to be coded in modules; thus, making the program easier to code and test.
A program can contain many procedures. Each procedure is delimited by the PROC and ENDP directives and contains identical names for each directive, as shown below. Each procedure must have a unique ...
Get X86 Assembly Language and C Fundamentals now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.