Passing Parameters

Parameters are generally passed to a subroutine by putting them on the stack with PUSH instructions prior to the CALL. Parameters are removed from the stack in one of two ways:

Note: 'C' convention PUSHes parameters from right to left.

Note: PASCAL convention PUSHes parameters left to right.

Because the NEAR versions of jump ( JMP ), CALL and RETurn DO NOT touch CS, there can be no change of privilege level during execution of any of them. The FAR versions of them do provide a new value for CS. If the new CS is the same privilege level as the current level, the only change from above is that CALL PUSHes CS before PUSHing IP. RETurn POPs IP before POPing CS.


[Back: Far CALL & RETurn]
[Next: Receiving Parameters]