subroutines - CSE 380 Subroutines & The Library File...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 380 Terminology Subroutine Routine called by higher level routine Function Subroutine which returns a value Procedure Subroutine which carries out operation on data passed to routine Subroutines Why use subroutines? Readability Simplifies Design Simplifies Testing Modularity Ease of Modification Code Reuse Leaf Routines A routine which does NOT call another routine. If a routine is not a leaf routine, you MUST preserve the link register BEFORE you call another routine! What is the difference between B cc and BL (where cc = condition code)? Are they interchangeable? Creating a Library of Subroutines Library File Making routines available to subroutines in another file. Every routine you want to call from another file must be exported by including the following line for each routine you export EXPORT routine_name where routine_name is the name of the routine you are exporting Calling routines stored in another file must be declared as external For every routine you want to import from another file, include the following line EXTERN routine_name where routine_name is the name of the routine you are importing
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ARM Procedure Call Standard APCS Register Convention
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

subroutines - CSE 380 Subroutines & The Library File...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online