Subroutines Flashcards
Subroutines allow?
The repetition of calculations using varying arguments
Open (inline) Subroutines are?
Subroutines where the code is inserted inline wherever the subroutine is invoked (usually using macro pre-preocessor)
Closed Subroutines are?
Subroutines where the code for the routine only appears once in RAM
When invoked control jumps to the first instruction of the routine and when finished control returns to the next instruction in the calling code
What are the maximum amount of arguments that can be passed to a subroutine?
8, in registers x0-x7
What are Pointer Arguments?
Arguments where the memory address of a local variable is passed to the subroutine
Variable will be in RAM not a register
If there are more than 8 arguments where must they go?
The are passed on the stack
Sometimes called spilled arguments