Page 1 of 1

Cursor Help

Posted: Thu Sep 26, 2002 4:37 pm
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?

Re:Cursor Help

Posted: Fri Sep 27, 2002 3:13 am
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...

Re:Cursor Help

Posted: Fri Sep 27, 2002 10:07 am
by beyondsociety
How would I implement it in assembler?

Re:Cursor Help

Posted: Fri Sep 27, 2002 8:14 pm
by beyondsociety
I figured it out. Thanks anyways!