flat assembler
Message board for the users of flat assembler.
Index
> DOS > hide text-mode cursor |
Author |
|
Picnic 18 Jun 2007, 19:03
How to hide text-mode cursor?
I found a couple of examples on net but they don't work well under Win Xp console. |
|||
18 Jun 2007, 19:03 |
|
LocoDelAssembly 18 Jun 2007, 19:17
http://board.flatassembler.net/topic.php?t=7199 (I tested that code under WinXP SP2 32-bits)
|
|||
18 Jun 2007, 19:17 |
|
Picnic 18 Jun 2007, 20:13
Thank you people.
Both ways working but the first time only i open a new console window and run the program. If i exit back to dos and re-run program, cursor is still there... Win XP Prof SP2 my PC. |
|||
18 Jun 2007, 20:13 |
|
Dex4u 19 Jun 2007, 03:31
You could try this:
Code: ;====================================================;; CursorShow. ;====================================================;CursorShow: push cx push ax mov ch,0x0b mov cl,0x0c mov ah,1 int 10h pop ax pop cx ret;====================================================;; CursorHide. ;====================================================;CursorHide: push cx push ax mov ch,0x1c mov cl,0x1b mov ah,1 int 10h pop ax pop cx ret But i have not tryed it in xp. |
|||
19 Jun 2007, 03:31 |
|
DJ Mauretto 19 Jun 2007, 10:01
please post your code
i don't understand your problem |
|||
19 Jun 2007, 10:01 |
|
Picnic 19 Jun 2007, 16:18
Thank you Dex, still i'm having the same problem.
Just a test file DJ Mauretto. Like this one below: Code: org 100h call CursorHide xor ax,ax int 16h call CursorShow int 20h ; routines ; ... Script works fine the first time, i hit a key to exit, type program's name in console to run again, and the cursor flashing.. All scripts works fine on DosBox Emulator, but not on my XP console. |
|||
19 Jun 2007, 16:18 |
|
DJ Mauretto 19 Jun 2007, 18:14
This work fine on Xp
Code: org 100h use16 mov ah,0fh int 10h ;======= ; HIDE ;======= mov dh,25 mov dl,0 call HIDE_RESTORE_CURSOR sub ax,ax int 16h ;========== ; RESTORE ;========== mov dh,1 mov dl,0 call HIDE_RESTORE_CURSOR mov ax,4c00h int 21h ;======================== ; Entry: DH = Row (Y) ; DL = Column (X) ;======================== HIDE_RESTORE_CURSOR: push es xor cx,cx mov es,cx mov [es:0450h],dx ; Update System Variable mov al,dh mov bl,80 mul bl ; Y * 80 movzx dx,dl add ax,dx ; AX = Y * 80 + X mov cx,ax ; Save for later mov dx,03d4h ; CRT Register mov al,0eh ; INDEX High Side out dx,ax add al,1 ; INDEX Low Side mov ah,cl out dx,ax pop es ret |
|||
19 Jun 2007, 18:14 |
|
Picnic 19 Jun 2007, 18:36
Still the same. I'm testing it on Win XP dos console, both on my desktop and laptop PC.
Thank you for your interest DJ Mauretto. I don't know why is doing that.. |
|||
19 Jun 2007, 18:36 |
|
DJ Mauretto 19 Jun 2007, 18:45
maybe i don't uderstand the effect that you want... in my xp pro sp2 it's ok.. i test it in this way: run cmd.exe ,run program ,now cursor is out the screen and program wait a key,type any key and the cursor is on. run program another time ,cursor is out the screen , program wait any key ,type key and cursor is on.. OK ? |
|||
19 Jun 2007, 18:45 |
|
Picnic 19 Jun 2007, 18:52
exactly, i'm doing the same.
But only the first time cursor is out the screen. |
|||
19 Jun 2007, 18:52 |
|
DJ Mauretto 19 Jun 2007, 18:56
do you use my code without any change ?
|
|||
19 Jun 2007, 18:56 |
|
Picnic 19 Jun 2007, 18:59
Yes, copy-paste..
|
|||
19 Jun 2007, 18:59 |
|
DJ Mauretto 19 Jun 2007, 19:01
type command in console mode , or press ALT+ENTER on cmd.exe
it's cmd.exe problem... anyway for dos console under Xp use command.com |
|||
19 Jun 2007, 19:01 |
|
Picnic 19 Jun 2007, 19:30
Grazie DJ Mauretto
All scripts are working. |
|||
19 Jun 2007, 19:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.