i'm searching everywhere to learn how to find the console coord (x, y position) not give it new coord, just find out what the coordinates are for the cursor.
thanx in advance
Printable View
i'm searching everywhere to learn how to find the console coord (x, y position) not give it new coord, just find out what the coordinates are for the cursor.
thanx in advance
Ive dont this in ASM before, ive posted the code below incase it helps.
The other way of doing it in dos is to use interupt 10, 3 (though i havent used this method before). Heres a discription of how to use it:Code:mov dx, 0x03D4 ;Get Cursor Position MSB
mov al, 0x0E
out dx, al
mov dx, 0x03D5
in al, dx
shl ax, 8 ;Store MSB in ah
mov dx, 0x03D4 ;Get Cursor Position LSB
mov al, 0x0F
out dx, al
mov dx, 0x03D5
in al, dx ;Store LSB in al
mov bh, 80 ;Divide to get XY coordinates (X in ah and Y in al)
div bh
xchg ah, al ;The Y coordinate must be first and the X coordinate last
Code:Int 10
AH = 0x03
BH = Video page - probably 0
On return:
DH = Y co-ord
DL = X co-ord
You can use ansi escape codes to save the cursor position.
Quzah.
Well not really, because the method i used (the first one) actually reads the graphic controllers curser position so will work in any OS (actually i did it in the absence of an OS).
Oh really? On a SUN system? On an Alpha? On a ...Quote:
Originally posted by VBprogrammer
Well not really, because the method i used (the first one) actually reads the graphic controllers curser position so will work in any OS (actually i did it in the absence of an OS).
Quzah.
i'll try some of the stuff you guys suggested, all i need it for is windows, thanx for the help so far ;)
Did I miss something..? When did assembler become portable?Quote:
Originally posted by VBprogrammer
Well not really, because the method i used (the first one) actually reads the graphic controllers curser position so will work in any OS (actually i did it in the absence of an OS).
i've ready the ansi escape codes and i'm pretty sure this is what i need
but i'm not sure how to use this, any help?Quote:
ESC[s
Save Cursor Position: Saves the current cursor position. You can move
the cursor to the saved cursor position by using the Restore Cursor
Position sequence.
ps thanx VBprogrammer for the code but i have no idea how to use asm or the code you posted.