ISA & Assembly
Which correctly describes an ABI (application binary interface)?
- AAn agreement at the source-code level defining function names and argument types
- BAn agreement defining only the kinds of CPU instructions and their bit layouts
- 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.