Convertir código de ensamblaje en línea a C ++

Estoy trabajando en un proyecto cpp. El proyecto necesita ser migrado a 64 bits. Contiene algún código de ensamblaje en línea que no se puede compilar en x64. Esta es la función que contiene el código de ensamblaje:

void ExternalFunctionCall::callFunction(ArgType resultType, void* resultBuffer)
{
#if defined(_NT_) || defined(__OS2__)

    // I386

    // just copy the args buffer to the stack (it's already layed out correctly)
    int* begin = m_argsBegin;
    int* ptr = m_argsEnd;
    int arr[1000], i=0;
    while (ptr > begin) {
        int val = *(--ptr);

        __asm push val
    }

    void* functionAddress = m_functionAddress;

    // call the function & handle the return value.  use __stdcall calling convention
    switch (resultType) {
    case voidType:
        __asm {
            call functionAddress
        }
        break;
    case pointerType:
    case int32Type:
        __asm {
            call functionAddress
            mov ebx, resultBuffer
            mov dword ptr [ebx],eax
        }
        break;
    case floatType:
        __asm {
            call functionAddress
            mov ebx, resultBuffer
            fstp dword ptr [ebx]
        }
        break;
    case doubleType:
        __asm {
            call functionAddress
            mov ebx, resultBuffer
            fstp qword ptr [ebx]
        }
        break;
    }

Utilicé stack, array para migrar este "asm push val" pero no funcionó. Aunque, no arroja ningún error de compilación pero la lógica no funcionó.

Entonces, quiero preguntar qué puedo usar en C ++ en lugar de "__asm ​​push val". Cualquier ayuda será apreciada.

Respuestas a la pregunta(3)

Su respuesta a la pregunta