ISA & Assembly

Which correctly describes an ABI (application binary interface)?

  1. AAn agreement at the source-code level defining function names and argument types
  2. BAn agreement defining only the kinds of CPU instructions and their bit layouts
  3. CA set of machine-level agreements, such as calling conventions and data type sizes and alignment, that let programs interoperate
Show answer and explanation

Answer: C. A set of machine-level agreements, such as calling conventions and data type sizes and alignment, that let programs interoperate

An ABI is the machine-level agreement that lets compiled programs and libraries work together. It covers the calling convention, the sizes of int, long and pointers, struct alignment, how system calls are made and so on. An API defines how functions are used at the source level; even with the same API, a different ABI means a library cannot be used without rebuilding. The same RISC-V ISA can have different ABIs depending on the OS or application.

  • A. That is an API (application programming interface).
  • B. That is the ISA; the ABI sits on top of it.
  • C. Correct. It is an agreement between compiled pieces of code.
Practice this topic Back to topic

More ISA & Assembly questions

  1. How is a call through a C function pointer, "(*fp)(x)", generally performed in RISC-V?
  2. Which statement is correct about two CPUs that implement the same instruction set architecture (ISA)?
  3. What is a characteristic of a load-store architecture such as RISC-V?
  4. What is the property of register x0 (zero) in RISC-V?
  5. Which describes the general-purpose integer registers of RISC-V RV32I (the 32-bit base integer instruction set)?