Page 1 of 1

VGA hardware cursor and hardware scrolling

Posted: Wed Jun 26, 2002 2:23 pm
by FlashBurn
I want to know how this 2 things work . It would be nice of you , if you could post some code . I need this for RM , it?s only , if the code is other as the code in PM (bad english !!) .

Re:VGA hardware cursor and hardware scrolling

Posted: Wed Jun 26, 2002 7:19 pm
by crazybuddha
Perhaps this will help get you started

http://www.execpc.com/~geezer/osd/cons/index.htm

As far as real mode vs pmode, if you're just dealing with ports (using IN/OUT in assembly), it's the same.

Re:VGA hardware cursor and hardware scrolling

Posted: Thu Jun 27, 2002 1:21 am
by FlashBurn
I?ve tried to write this code in asm , but when I want to write a value out to the register 0x3d4 NASM says me "invalid combination of opcodes and operands" .
Here is my code :

move_cursor:
???pusha
???mov al,80
???mul byte[spalte]
???mov bx,ax
???mov al,[zeile]
???cbw
???add bx,ax
???out 0x3D4,14
???mov dx,bx
???shr dx,8
???out 0x3d5,dx
???out 0x3d4,15
???out 0x3d5,bx
???popa
???ret

Re:VGA hardware cursor and hardware scrolling

Posted: Thu Jun 27, 2002 4:28 am
by alfhiger
out 0x3D4,14 is not allowed

mov al, 14
mov dx, 0x3D4
out dx, al

Re:VGA hardware cursor and hardware scrolling

Posted: Thu Jun 27, 2002 5:42 am
by crazybuddha
It's not allowed because you can't use a constant (a number) if it's bigger than one byte.