cursor.c
来自「Linux0.01内核分析与操作系统设计 随书源代码」· C语言 代码 · 共 20 行
C
20 行
/* Compiled by DJGPP */#include <stdio.h>#include <pc.h>void update_cursor(int row, int col){ USHORT position=(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));}void main(){ clrscr(); update_cursor(10, 10);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?