Text Mode Cursor: Difference between revisions

m
Bot: Replace deprecated source tag with syntaxhighlight
[unchecked revision][unchecked revision]
m (Reverted edits by Melina148 (talk) to last revision by Tetraxile)
m (Bot: Replace deprecated source tag with syntaxhighlight)
Line 47:
'''Source in C'''
 
<sourcesyntaxhighlight lang="c">
void enable_cursor(uint8_t cursor_start, uint8_t cursor_end)
{
Line 56:
outb(0x3D5, (inb(0x3D5) & 0xE0) | cursor_end);
}
</syntaxhighlight>
</source>
 
===Disabling the Cursor===
Line 62:
'''Source in C'''
 
<sourcesyntaxhighlight lang="c">
void disable_cursor()
{
Line 68:
outb(0x3D5, 0x20);
}
</syntaxhighlight>
</source>
 
'''Source in Assembly'''
 
<sourcesyntaxhighlight lang="asm">
disable_cursor:
pushf
Line 90:
popf
ret
</syntaxhighlight>
</source>
 
===Moving the Cursor===
Line 98:
'''Source in C'''
 
<sourcesyntaxhighlight lang="c">
void update_cursor(int x, int y)
{
Line 108:
outb(0x3D5, (uint8_t) ((pos >> 8) & 0xFF));
}
</syntaxhighlight>
</source>
 
'''Source in Assembly'''
 
<sourcesyntaxhighlight lang="asm">
Cursor:
VGA.Width equ 80
Line 144:
out dx, al
ret
</syntaxhighlight>
</source>
 
===Get Cursor Position===