However a better question would always be "How can I hide the console cursor?", because I doubt sincerely that your method will even work, it is making a 16bit Int10 BIOS call, MinGW/GCC is a 32bit compiler. The Windows console is not DOS, it does not have to respond to such calls, and the Win32 environment prevents or at least virtualises such calls.
Even if it did work, why would you resort to assembler to do such a thing?
There is a simpler way that will work without resorting ancient, arcane, non-portable and obsolete practices: Use the appropriate Win32 Console API call. http://msdn.microsoft.com/en-us/library/ms686019(VS.85).aspx
void CursorHidden ()
{
_asm mov cx, 0x2000
_asm mov ah, 1
_asm int 0x10
}
How do i get this to work in dev c++, it hides the console cursor =)
> How do i get this to work in dev c++ [?]
Make it correct GNU in-line assembler syntax: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
However a better question would always be "How can I hide the console cursor?", because I doubt sincerely that your method will even work, it is making a 16bit Int10 BIOS call, MinGW/GCC is a 32bit compiler. The Windows console is not DOS, it does not have to respond to such calls, and the Win32 environment prevents or at least virtualises such calls.
Even if it did work, why would you resort to assembler to do such a thing?
There is a simpler way that will work without resorting ancient, arcane, non-portable and obsolete practices: Use the appropriate Win32 Console API call. http://msdn.microsoft.com/en-us/library/ms686019(VS.85).aspx
To get the necessary console handle: http://msdn.microsoft.com/en-us/library/ms683231(VS.85).aspx
So something like (untested):
include <windows.h>
void CursorHidden()
{
HANDLE console_out = GetStdHandle( STD_OUTPUT_HANDLE ) ;
CONSOLE_CURSOR_INFO cursor ;
GetConsoleCursorInfo( &cursor ) ;
cursor.bVisible = FALSE ;
SetConsoleCursorInfo(console_out, &cursor ) ;
}
Clifford