Thread: Getting the hardware cursor position

  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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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, 06: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, 01:46 PM
  5. Linux Hardware Handbook
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 04-02-2002, 06:06 AM