thanks everyone, still having problems though
So I triedI fooling around with trying to get OMT/obj to work by adding BITS 32 but it didn't work, so I tried MinGW (g++)
I went to the minGW page (worst website ever) and downloaded the stuff. I installed it and added it to my path, but it didn't want to work so I am calling it with the full name. So I tried to get a minimal C++ program running but it wanted a WinMain instead of a main so I ended up with the following:
#include <iostream>using namespace std;extern "C" int TimesThree(int i);#include <windows.h> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { //MessageBox (NULL, "Hello", "Hello Demo", MB_OK); int x=5; cout<<TimesThree(x)<<endl; return (0); }
and my tt.asm as before, though I added the BITS 32
BITS 32global _TimesThree_TimesThree: push ebp mov ebp, esp mov eax, [ebp+8] imul eax, [eax], 3 leave ret
then I used:
nasm -f coff tt.asm
\MinGW\bin\g++ -o test.exe test.cpp tt.o
for the error I get:
(.text+0x114): undefined reference to `TimesThree'