Text Mode Cursor: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m →‎External Links: Remove the dead link notice, provide the link to archived page only
1
Line 83: Line 83:
ret
ret
</source>
</source>

==Disabling The Cursor With the BIOS==

Moving the cursor with the [[BIOS]] is done through Int 0x10 (The general interrupt for screen functions) with AH set to 0x02. These are the registers used:
* AH = 0x01
* CH = 0x3f ; bits 6-7 are unused , if bit 5 set the cursor is disable (this bit may be cleared in the interrupt caller , see "Disabling The Cursor Without the BIOS" for safer way to disable the cursor) , bits 0-4 controll the cursor shape (if bits 0-4 all set the cursor is unvisiable regradless what's bit 5's state.)

And then Interrupt 0x10 and then vuala , there is no *VISIBLE cursor on the screen

*Even on GUI modes the cursor remains active so don't think about it to much.

==Disabling The Cursor Without the BIOS==

===Source in C===
<source lang="c">
/* void disable_cursor()
* by Elad Ashkcenazi
*/
void update_cursor()
{

outb(0x3D4, 0x0A);
outb(0x3D5, 0x3f); bits 6-7 must be 0 , if bit 5 set the cursor is disable , bits 0-4 controll the cursor shape (if bits 0-4 all set the cursor is unvisiable regardless what's bit 5 state.)
// cursor shape port to vga INDEX register
}
</source>

===Source in assembly===

<source lang="asm">
made by Elad Ashkcenazi
;=============================================================================
disable_cursor: pushfq
push rax
push rdx

mov dx,0x3d4
mov al,0xa ; index 0xa is the LOW cursor shape register
out dx,al

inc dx
mov al,0x3f ; bits 6-7 must be 0 , if bit 5 set the cursor is disable , bits 0-4 controll the cursor shape (if bits 0-4 all set the cursor is unvisiable regardless what's bit 5 state.)
out dx,al
pop rdx
pop rax
popfq
ret
</source>



==See Also==
==See Also==
Line 90: Line 139:
* http://www.bookcase.com/library/dos/ints/int10.html (dead link)
* http://www.bookcase.com/library/dos/ints/int10.html (dead link)
* https://web.archive.org/web/20120324083032/http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_13/CH13-2.html
* https://web.archive.org/web/20120324083032/http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_13/CH13-2.html
* http://www.osdever.net/FreeVGA/vga/vga.htm

[[Category:Video]]
[[Category:Video]]
[[Category:VGA]]
[[Category:VGA]]