C files with inline-asm into bmax?

BlitzMax Forums/BlitzMax Programming/C files with inline-asm into bmax?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks guys for your help, Ive got it working now.

This is what it should have been...

//---- file: cpuspeed.c ----

#include <windows.h>

unsigned __int64 start, stop;
unsigned __int64 nCtr, nFreq, nCtrStop;

int CpuSpeed(void)
{
    QueryPerformanceFrequency((LARGE_INTEGER *)&nFreq);

    __asm__(".byte 0x0F");
    __asm__(".byte 0x31");
    __asm__("mov %eax,_start");
    __asm__("mov %edx,4+(_start)");
	
    QueryPerformanceCounter((LARGE_INTEGER *)&nCtrStop);
    nCtrStop += nFreq;
    do
	{
        QueryPerformanceCounter((LARGE_INTEGER *)&nCtr);
    } while (nCtr < nCtrStop);

    __asm__(".byte 0x0F");
    __asm__(".byte 0x31");
    __asm__("mov %eax,_stop");
    __asm__("mov %edx,4+(_stop)");

    return ((stop-start)/1000000);
}