Thread: Fatal error :/

  1. #1
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704

    Fatal error :/

    IM trying to get into vga or svga mode in dos. Ive got my program to compile, but when i run it i get this fatal error:
    A fatal exception 0D has occured at c166: 00000447

    Any one know how to fix this, or what the problem is. Heres the code.

    #include <iostream.h>
    #include <conio.h>

    unsigned char *Screen = (unsigned char *) 0xA0000000;

    void initGraph (void)
    {
    __asm {
    mov ax, 13h
    int 10h
    }
    }

    void finishGraph (void)
    {
    __asm {
    mov ax, 03h
    int 10h
    }
    }

    void Plot (int x, int y, unsigned char color, unsigned char *buffer)
    {
    buffer[(y<<8)+(y<<6)+x] = color;
    return;
    }


    int main (void)
    {
    initGraph();

    Screen[0] = 3;

    Plot(0, 0, 3, Screen);

    getch();
    finishGraph();


    return 0;
    }

    Thanks.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If the program did work, why are you writing two consecutive pixels to offset 0 of the same color?


    Fatal exception 0D is a General Protection Exception. This is most likely being caused by a null pointer in your code.

    However, I copied your code exactly into my IDE and ran it. It works fine on my machine. I even tested it with different values and it worked. You don't need to include iostream.h for this code snippet.

    If you are in a DOS shell, try rebooting the system and retrying the program. If you've been programming for some time on this code, chances are you have ran it many, many times. Sometimes, running the program with errors in the code may not crash the machine, but it will not allow other correctly coded programs to run. This makes it very hard to debug a program when it won't run regardless of whether or not it is correct.

    This has happened to me while in a DOS shell. Even though your code is correct now, you may have ran it before when it was not. That error may have corrupted something which will require to you reboot the system. You might be able to close down the DOS shell and then go back into DOS and retry your program. Best bet though is to reboot, even reset, and retry.

  3. #3
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    what compiler are you using? i can't find any syntactical errors either...
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM