Cursor Help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
beyondsociety

Cursor Help

Post by beyondsociety »

I am trying to get the cursor to work. I want to use this simple cursor code in protected mode. It works fine in a real mode bootsector.

mov ah,2 ; Set cursor fubction
mov dh,10 ; Row 10
mov dl,20 ; Column 20
mov bh,0 ; Video page 0
int 10h ; Call BIOS

I would be able to use this code but considering I can't use the int 10h because its a bios interrupt , Im stuck.

How can I use this code in protected mode?
How would I get around the bios interrupt?
Whatever5k

Re:Cursor Help

Post by Whatever5k »

look at this:

Code: Select all

/* void update_cursor(int row, int col)
 * by Dark Fiber
 */
void update_cursor(int row, int col)
{
USHORTposition=(row*80) + col; // cursor LOW port to vga INDEX register
outb(0x3D4, 0x0F);
outb(0x3D5, (UCHAR)(position&0xFF));
// cursor HIGH port to vga INDEX register
outb(0x3D4, 0x0E);
outb(0x3D5, (UCHAR)((position>>8)&0xFF));
}
Easy to implement in assembler, too...
beyondsociety

Re:Cursor Help

Post by beyondsociety »

How would I implement it in assembler?
beyondsociety

Re:Cursor Help

Post by beyondsociety »

I figured it out. Thanks anyways!
Post Reply