D - asm, access violation?
- LightEater (14/14) Apr 29 2004 Hi,
- imr1984 (4/18) Apr 29 2004 i ran that code in C++ and it does the same thing, it throws when int 0x...
- LightEater (3/6) Apr 29 2004 Well, int is used for executing interrupts and int 10h, function 2 is
- Norbert Nemec (4/21) Apr 29 2004 Wow - I didn't see something like that since the old days of programming
- Walter (7/20) Apr 29 2004 function
Hi, I'm trying to set the cursor position using inline asm, i came up with the following nifty function, the program compiles, however when i call the function i get an "Error: Access Violation". Any ideas on what might be wrong? void GotoXY (ubyte x, ubyte y) { asm { mov AH, 2; /* cursor position */ mov DH, y; mov DL, x; int 0x10; } }
Apr 29 2004
i ran that code in C++ and it does the same thing, it throws when int 0x10 is called. Maybe thats a protected instruction? I dont really know much about the int instruction sorry :( (what does it do anyway?) In article <c6qlmd$omq$1 digitaldaemon.com>, LightEater says...Hi, I'm trying to set the cursor position using inline asm, i came up with the following nifty function, the program compiles, however when i call the function i get an "Error: Access Violation". Any ideas on what might be wrong? void GotoXY (ubyte x, ubyte y) { asm { mov AH, 2; /* cursor position */ mov DH, y; mov DL, x; int 0x10; } }
Apr 29 2004
In article imr1984 says...i ran that code in C++ and it does the same thing, it throws when int 0x10 is called. Maybe thats a protected instruction? I dont really know much about the int instruction sorry :( (what does it do anyway?)Well, int is used for executing interrupts and int 10h, function 2 is supposed to set cursor position :o
Apr 29 2004
LightEater wrote:Hi, I'm trying to set the cursor position using inline asm, i came up with the following nifty function, the program compiles, however when i call the function i get an "Error: Access Violation". Any ideas on what might be wrong? void GotoXY (ubyte x, ubyte y) { asm { mov AH, 2; /* cursor position */ mov DH, y; mov DL, x; int 0x10; } }Wow - I didn't see something like that since the old days of programming DOS. What do you want to do? BIOS programming? No reasonably modern OS would base cursor handling on BIOS calls.
Apr 29 2004
"LightEater" <LightEater_member pathlink.com> wrote in message news:c6qlmd$omq$1 digitaldaemon.com...I'm trying to set the cursor position using inline asm, i came up with the following nifty function, the program compiles, however when i call thefunctioni get an "Error: Access Violation". Any ideas on what might be wrong? void GotoXY (ubyte x, ubyte y) { asm { mov AH, 2; /* cursor position */ mov DH, y; mov DL, x; int 0x10; } }Generating interrupts only works when running a 16 bit program. D only supports 32 bit programming. Generating an interrupt from a Win32 program will cause an access violation. To set the cursor position in a 32 bit Win32 program, check out the Windows console API.
Apr 29 2004