' Mixed Language — ASM via #ASM/#ENDASM with Win64 calling convention
#COMPILE EXE
#DIM ALL

FUNCTION AddASM(BYVAL a AS LONG, BYVAL b AS LONG) AS LONG
'     #ASM
'         mov eax, ecx
'         add eax, edx
'         leave
'         ret
'     #ENDASM
END FUNCTION

FUNCTION PBMAIN() AS LONG
    LOCAL r AS LONG

    r = AddASM(10, 20)
    PRINT "AddASM(10, 20) = "; r

    r = AddASM(100, 200)
    PRINT "AddASM(100, 200) = "; r

    FUNCTION = 0
END FUNCTION
