From: Tor L. <tm...@ik...> - 2010-06-17 08:25:30
|
As nobody else seems to bother replying, I will try. But note that I am not an expert in assembler programming. Anyway, I think what you are doing has several fundamental mistakes: > int 21h Isn't "int 21h" something one did in MS-DOS? Windows NT (which is what all current Windowses are) is not MS-DOS. MinGW is not a MS-DOS toolchain. You can't do that. (And even on MS-DOS, shouldn't you return from the function after the int 21h?) > nasm -f elf mouse.asm -o mouse.elf Why ELF? The object files used by MinGW (and Microsoft's tools) are not in ELF format, but PE-COFF I think it is called. > #include <iostream> Just a matter of preference here, but why use C++ for low-level programming like this? It seems a bit weird to on one hand use assembler (presumably to minimize code size?) and then use C++. Just use plain C and avoid all the additional problems that C++ might bring. > extern void mausstate(void); So here you declare an external function called mausstate. > mausstate; What is this supposed to do? It does nothing. If you want to call the mausstate function, write: mausstate() ; Use the -Wall flag. It really is useful. > I can compile this this project, but the program doesn’t show me the mouse > and the other values. What you probably should do is forget all that ancient MS-DOS interrupt stuff and read up on the Win32 console API. For instance GetConsoleCursorInfo(), SetConsoleCursorInfo(), WriteConsole(), etc. Or, if you actually are writing MS-DOS code, you can't use MinGW. Perhaps you want DJGPP? > How can I link precompiled classes usable? There are no "classes" in your assembler snippet. Don't use C++ terminology for something that is not C++. > How can I use them in the mainprogram? See above, you didn't actually call the functions in your assembler code, you just had the function name as a do-nothing expression statement. --tml |