spo600:procedure_call
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
spo600:procedure_call [2025/02/19 17:19] – chris | spo600:procedure_call [2025/02/19 17:42] (current) – chris | ||
---|---|---|---|
Line 6: | Line 6: | ||
- A program (known as the //caller//) uses an [[instruction]] to invoke the procedure. This is known as " | - A program (known as the //caller//) uses an [[instruction]] to invoke the procedure. This is known as " | ||
- The current value of the [[register# | - The current value of the [[register# | ||
- | - The address of the entry point in the called procedure is loaded into the system' | + | - The address of the entry point in the called procedure is loaded into the program counter. This causes the first instruction of the procedure to be executed next. |
- The called procedure (known as the //callee//) executes zero or more instructions. | - The called procedure (known as the //callee//) executes zero or more instructions. | ||
- The callee executes an instruction to //return// to the caller. | - The callee executes an instruction to //return// to the caller. | ||
- | - The return operation is performed by loading the return address into the [[register# | + | - The return operation is performed by loading the return address into the [[register# |
The actual value of the return address saved during a procedure call may be the address of the first byte of the call instruction, | The actual value of the return address saved during a procedure call may be the address of the first byte of the call instruction, | ||
Line 17: | Line 17: | ||
* Other systems store the return address on the [[stack]]. This is slower but does not require additional code when performing a subsequent call. | * Other systems store the return address on the [[stack]]. This is slower but does not require additional code when performing a subsequent call. | ||
+ | The location of parameters passed to a procedure, the location of the return value(s), and which registers must be preserved by the called procedure and which ones may be clobbered, is not usually defined as part of the hardware architecture, |
spo600/procedure_call.1739985575.txt.gz · Last modified: 2025/02/19 17:19 by chris