Hey all, I'm a bit new to Assembly language.
What I'm trying to do is to write an integer value to a COM port on Windows. The way I think I can do this is by using the fwrite function supplied with C, and having a pointer to an integer that I use with that function. I got this working in C just fine, now I need to get it to work in Assembly. (I don't know if this is the best way to do this)
So far I have this (in Visual Studio 2008):
int myint = 12000;
int *myintptr = &myint;
//...blah blah, portptr is declared and set up too (i know this works)
mov eax, DWORD PTR(portptr)
mov ecx, DWORD PTR(myintptr)
call DWORD PTR(fwrite) ;it breaks on this line
add esp, 10h
That general method for calling functions works fine for fgetc, fputc, fopen etc... but not for fwrite unless I've done something wrong there.
Any help is greatly appreciated!