© Thomas Kunz 2000
SCE 574
103
Difference with C Calling Conventions
äC calling conventions
äParameters are passed by value only
äValues can be addresses of variables (ie. &my_variable) so this isn’t a big restriction
äParameters are passed in a reverse order
äSubroutine does not pop the parameters off the stack before returning
äPop is done by the caller
äSubroutine doesn’t have to know how many parameters are passed to it (it can be deduced at runtime) just RET
äOther differences
äPascal assumes you will not change the BP, DS, and SS registers and the direction flag must be cleared
äC assumes SI, DP, BP and direction flag will not be changed
äOther languages make other assumptions about use of registers etc., order of parameters etc.
äInterlanguage calls need pragmas to explain which calling conventions should be used