#include <stdio.h> #include <conio.h> int main(void) { char video[64], key, page, col, str; clrscr(); asm { push ds pop es mov ah, 0x1B mov bx, 0x00 lea di, video int 0x10 } page = video[0x1D]; col = video[0x0B+page*2]; str = video[0x0C+page*2]; //printf("%x",*((unsigned int *)(video+9))); while (1) { key = getch(); if ((key == 72) || (key == 75) || (key == 77) || (key == 80)) { if ((key == 72) && str) str--; // up else if ((key == 80) && (str < video[0x22]-1)) str++; // down else if ((key == 75) && col) col--; // left else if ((key == 77) && (col < video[0x05]-1)) col++; // right asm { mov ah, 0x02 mov bh, page mov dh, str mov dl, col int 0x10 } } else if (key == 27) return 0; } } |