x86 Hybrid Programming

Documentation

Types
'old' data types have alignment <=4

Registers

Current version requires the ESP to be aligned to a boundary of at least 16 immediately before procedure call - the address of the first argument of a procedure is n16
this is achieved by adjusting the stack pointer before pushing the arguments
the arguments may by placed on stack by using PUSH arg or (after adjusting & moving the SP) MOV [ESP+disp], arg

Function prologue and epilogue

University/WUT/ECOAR/pictures/Pasted image 20250331175742.png
The prologue sets up data in such a way, that the first argument is accessible at [ebp + 8] - which applies to the calling convention
the laboratories require the calling convention to be ensured