interrupt

This is a discussion on interrupt within the C++ Programming forums, part of the General Programming Boards category; How to call a dos interrupt ? I want to change the screen mode. I'm using DevC++...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    11

    Question interrupt

    How to call a dos interrupt ? I want to change the screen mode.
    I'm using DevC++

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    You could use inline assembly, like

    Code:
    asm mov ah,0x00;
    asm mov al,0x13;
    asm int 0x10;
    Or you could use a function for that

    Code:
    union REGS regs;
    
    regs.h.ah = 0x00;
    regs.h.al = 0x13;
    int86(0x10, & regs, & regs);
    Note that this all is very compiler specific. I don't know if one of these or both work with DevC++.

    [edit]The spaces between & and regs should be removed, but when I write them without spaces, this &regs happens.[/edit]
    Last edited by Shiro; 05-20-2002 at 08:25 AM.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    30

    Neither works for me...

    If I use the assembly code, it compiles but when run, crashes. The other code doesnŽt compile.
    (using msvc++)

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    Could be. The first one is inline assembly in Boraland C, the second one uses a Borland C specific function.

    The point was that you can use inline assembly or a specific function to call interrupts. How to do this is compiler dependent, consult the documentation of your compiler on how to do this.

    Also see this thread: http://www.cprogramming.com/cboard/s...ight=interrupt

  5. #5
    Registered User
    Join Date
    May 2002
    Posts
    30

    Thanks for the info!

    IŽll check it out...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer within a Struct
    By Bladactania in forum C Programming
    Replies: 11
    Last Post: 04-03-2009, 11:20 PM
  2. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM
  3. interrupt question
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 02-08-2002, 09:25 PM
  4. interrupt handler functions in Visual C++ 6.0
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 01-07-2002, 07:06 PM
  5. Sound card interrupt problems
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-05-2001, 04:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21