Brain-Score 91/100 TECH Embedded Systems and Deep Learning · 8:03

Lecture 30. Passing Arguments to a Subroutine

3-Second Blueprint (English)

  1. Following the ARM procedure call standard lets separately compiled C functions and assembly subroutines interoperate reliably via an ABI.
  2. Up to four 32-bit arguments pass in registers r0–r3 (paired for 64-bit values), and return results pass back in r0 before calling BX LR.
  3. Arguments beyond four are pushed onto the full descending stack; callees read them via LDRD without POP so the caller cleans up SP.
ARM AAPCS Calling ConventionRegisters r0–r3Full Descending StackLDRD & BX LR

3-Sekunden-Fazit (Deutsch)

  1. Der ARM-Aufrufstandard (ABI) definiert feste Schnittstellen, damit getrennt kompilierter C-Code und Assembler-Routinen nahtlos kooperieren.
  2. Bis zu vier 32-Bit-Argumente liegen in r0–r3 (64-Bit paarweise), während Rückgabewerte vor dem Rücksprung per BX LR in r0 abgelegt werden.
  3. Weitere Argumente landen auf dem Full-Descending-Stack; Unterprogramme lesen sie per LDRD ohne POP, bevor der Aufrufer den Stackpointer räumt.
ARM-ABI-AufrufkonventionRegister r0–r3Full-Descending-StackLDRD & BX LR

Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.