Entry and exit code
Each Pascal procedure and function begins and ends with standard epilog and prolog code.
Intel 80x86 standard routine prolog / epilog
Standard entry code for procedures and functions is as follows on the 80x86 architecture:
pushl %ebp movl %esp,%ebp
The generated exit sequence for procedure and functions looks as follows:
leave ret $xx
Where xx is the total size of the pushed parameters.
To have more information on function return values take a look at section Code issues.
Motorola 680x0 standard routine prolog / epilog
Standard entry code for procedures and functions is as follows on the 680x0 architecture:
move.l a6,-(sp) move.l sp,a6
The generated exit sequence for procedure and functions looks as follows (in the default processor mode):
unlk a6 rtd #xx
Where xx is the total size of the pushed parameters.
To have more information on function return values take a look at section Code issues.
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
