Getting the hardware cursor position

This is a discussion on Getting the hardware cursor position within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hey all, im writing a libary for console input/output functions (mostly just for practice & fun), and I don't know ...

  1. #1
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128

    Getting the hardware cursor position

    Hey all, im writing a libary for console input/output functions (mostly just for practice & fun), and I don't know how to get the hardware cursor position.

    So far i've got text color and text output down (using far pointers) but it always starts at 0,0 and I need the cursor position to find out where to start outputting text.

    Please no samples from libc or anything like that, i need something in ASM... (using djgpp..)

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Get Ralf Brown's interrupt list. You have to make a BIOS call or use port I/O to get the current position of the hardware cursor. It is available via interrupt 10, but I do not remember all of the specific register values or even which ones do what. I downloaded the port I/O map for the video card from........I think it was The Programmer's Lair - the URL is very diff from the name so look it up on a search engine.

  3. #3
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    Ok I found the list, from what it says is that I should set AH to 3 and call an interrupt, and DH and DL will have the row & column. Im checking if this works right now...

  4. #4
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    works perfectly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 06-24-2009, 09:49 AM
  2. Hardware interrupts
    By Sentral in forum Tech Board
    Replies: 5
    Last Post: 02-23-2009, 05:46 PM
  3. X-10 Hardware
    By jmd15 in forum Tech Board
    Replies: 1
    Last Post: 09-29-2005, 07:34 PM
  4. How does hardware interpret data?
    By Silvercord in forum Tech Board
    Replies: 3
    Last Post: 01-29-2003, 12:46 PM
  5. Linux Hardware Handbook
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 04-02-2002, 05:06 AM

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