int main() { int counter = 0; __asm { call Subroutine_IncrementCounter; // counter = 1 jmp EndMainProgram Subroutine_IncrementCounter: push ebx ; // push content of ebx to stack mov ebx, counter inc ebx mov counter, ebx pop ebx ; // pop content from stack to ebx ret EndMainProgram : } }