C++ ABIs or more specifically: DelphiVCL.Application.CPP_ABI_1, DelphiVCL.Application.CPP_ABI_2, and DelphiVCL.Application.CPP_ABI_3 inside DelphiVCL.Application is C++ ABIs (Application Binary Interfaces, which are implemented under the hood, including how parameters are passed, such as in a register or on the stack).
In windows development software but also especially for Linux, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.
ABI defines how data structures or computational routines are accessed in machine code, which is a low-level, hardware-dependent format. In contrast, an API defines this access in source code, which is a relatively high-level, hardware-independent, often human-readable format. A common aspect of an ABI is the calling convention, which determines how data is provided as input to or read as output from computational routines. For example, the x86 calling conventions.
Adhering to an ABI (which may or may not be officially standardized) is usually the job of a compiler, operating system, or library author. However, an application programmer may have to deal with an ABI directly when writing a program in a mix of programming languages, or even compiling a program written in the same language with different compilers.
Table of Contents
What do ABIs cover?
ABIs cover details such as:
- A processor instruction set (with details like register file structure, stack organization, memory access types, …)
- The sizes, layouts, and alignments of basic data types that the processor can directly access
- The calling convention, which controls how the arguments of functions are passed, and return values retrieved. For example, it controls:
- whether all parameters are passed on the stack, or some are passed in registers;
- which registers are used for which function parameters;
- and whether the first function parameter passed on the stack is pushed first or last.
- How an application should make system calls to the operating system, and if the ABI specifies direct system calls rather than procedure calls to system call stubs, the system call numbers.
- And in the case of a complete operating system ABI, the binary format of object files, program libraries, and so on.
ABI vs API
An API (Application Programming Interface, meaning the method declaration that you as a developer read and code against, including semantics such as passing by value) and ABI (application binary interface, meaning the way this is implemented under the hood, including how parameters are passed, such as in a register or on the stack). Read more here.
Is there a visual representation of ABIs?
Let’s browse all the properties and methods of the DelphiVCL.Application.CPP_ABI_1, CPP_ABI_2, and CPP_ABI_3 using dir() command:
1 2 3 4 5 |
import DelphiVCL dir(DelphiVCL.Application.CPP_ABI_1) dir(DelphiVCL.Application.CPP_ABI_2) dir(DelphiVCL.Application.CPP_ABI_3) |
See the responses in our Windows command prompt:
You can also read short information about the DelphiVCL.Application.CPP_ABI_1, CPP_ABI_2, and CPP_ABI_3 using the print() command:
1 2 3 4 5 6 7 8 |
print(DelphiVCL.Application.CPP_ABI_1) print(DelphiVCL.Application.CPP_ABI_1.__doc__) print(DelphiVCL.Application.CPP_ABI_2) print(DelphiVCL.Application.CPP_ABI_2.__doc__) print(DelphiVCL.Application.CPP_ABI_3) print(DelphiVCL.Application.CPP_ABI_3.__doc__) |
See the responses in our Windows command prompt:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.