1 | /* |
---|
2 | * videoAsm.S - This file contains code for displaying cursor on the console |
---|
3 | * |
---|
4 | * Copyright (C) 1998 valette@crf.canon.fr |
---|
5 | * |
---|
6 | * This code is free software; you can redistribute it and/or |
---|
7 | * modify it under the terms of the GNU Library General Public |
---|
8 | * License as published by the Free Software Foundation; either |
---|
9 | * version 2 of the License, or (at your option) any later version. |
---|
10 | * |
---|
11 | * This code is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | * Library General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU Library General Public |
---|
17 | * License along with this library; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | */ |
---|
20 | |
---|
21 | .file "videoAsm.s" |
---|
22 | |
---|
23 | #include <crt.h> |
---|
24 | |
---|
25 | .text |
---|
26 | .align 4 |
---|
27 | .globl wr_cursor /* Move cursor position */ |
---|
28 | |
---|
29 | /* |
---|
30 | * void wr_cursor(newPosition, ioBaseAddr) |
---|
31 | */ |
---|
32 | |
---|
33 | wr_cursor: pushl %ecx |
---|
34 | movl 8(%esp), %ecx /* Get new cursor position */ |
---|
35 | movb $CC_CURSHIGH, %al /* Cursor high location */ |
---|
36 | movl 12(%esp), %edx /* Get IO base address */ |
---|
37 | outb (%dx) |
---|
38 | incw %dx /* Program Data register */ |
---|
39 | movb %ch, %al |
---|
40 | outb (%dx) /* Update high location cursor */ |
---|
41 | decw %dx /* Program Index Register */ |
---|
42 | movb $CC_CURSLOW, %al /* Cursor low location */ |
---|
43 | outb (%dx) |
---|
44 | incw %dx /* Program Data Register */ |
---|
45 | movb %cl, %al |
---|
46 | outb (%dx) /* Update low location cursor */ |
---|
47 | popl %ecx |
---|
48 | ret |
---|