Lesson 042

Assembly Language Programming

Registers · Instructions · Calling Convention

1:00

How assembly language maps one-to-one onto machine code, how RISC-V registers and the four instruction families work, and how a calling convention and stack frame connect every function call.

By the end, you can

  • Explain the 1-to-1 relationship between an assembly mnemonic and a machine-code instruction.
  • State why assembly is not a universal language and give an example for three ISAs.
  • Distinguish registers from memory and identify which RISC-V instructions are allowed to access memory.
  • Classify any RISC-V instruction into one of the four families (load/store, arithmetic, branch, jump/call).
  • Trace a short register-arithmetic sequence and give the final register value.
  • Describe the fetch-decode-execute cycle and explain what a branch does to the program counter.
  • Explain how an if-statement and a loop each compile to branch instructions, including the direction of the jump.
  • Recall the roles of `a0`–`a7`, `ra`, `sp`, `s0`–`s11`, and `t0`–`t6` in the RISC-V calling convention.
  • Order the prologue and epilogue instructions of a stack frame and explain why `ra` must be saved before a nested call.
  • Name the four stages of the build pipeline (compiler, assembler, linker, loader) and what each one produces.
Up next in Computer Architecture & Operating Systems
Questions or feedback?