The rules for mangled names for variables and typed constants are as follows:
- All variable names are converted to upper case
- Variables in the main program or private to a unit have an underscore (_) prepended
to their names.
- Typed constants in the main program have a TC__ prepended to their names
- Public variables in a unit have their unit name prepended to them : U_UNITNAME_
- Public and private typed constants in a unit have their unit name prepended to them
:TC__UNITNAME$$
Examples:
unit testvars;
interface
const
publictypedconst : integer = 0;
var
publicvar : integer;
implementation
const
privatetypedconst : integer = 1;
var
privatevar : integer;
end.
Will result in the following assembler code for the gnu assembler :
.file "testvars.pas"
.text
.data
# [6] publictypedconst : integer = 0;
.globl TC__TESTVARS$$_PUBLICTYPEDCONST
TC__TESTVARS$$_PUBLICTYPEDCONST:
.short 0
# [12] privatetypedconst : integer = 1;
TC__TESTVARS$$_PRIVATETYPEDCONST:
.short 1
.bss
# [8] publicvar : integer;
.comm U_TESTVARS_PUBLICVAR,2
# [14] privatevar : integer;
.lcomm _PRIVATEVAR,2