flat assembler
Message board for the users of flat assembler.

Index > OS Construction > whats wrong with this cursor code?

Author
Thread Post new topic Reply to topic
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon 16 Mar 2005, 01:47
one thing i probably need to do is get the irq up and going..this code is called after vesa is setup..the cursor file is the cursor using this type of drawing..

i.e. B1 equ 00030303h
i.e. B1,00,B1,00,B1

im not sure what wrong with it or if its even right, but any help would be appreciated (fasm) ..thanks
Code:
include  '/INCLUDES/cursor.inc'
mov   ax,012h            ;set large graphics cursor block
mov   ax,cursor
mov   bh,16              ;cursor width in words
mov   ch,16              ;rows in cursor
mov   bl,1               ;horizontal hot spot
mov   cl,1               ;vertical hot spot
;es:dx                   ;bitmap of screen and cursor maps
int 33h                  ;enables the mouse interrupt
;#####################################################################
mov   ax,004h            ;position mouse cursor
mov   cx,320             ;column
mov   dx,250             ;row
int 33h                  ;enables the mouse interrupt
;#####################################################################
mov   ax,007h            ;define horizontal cursor range
mov   cx,800             ;minimum column
mov   dx,800             ;maximum column
int 33h
;#####################################################################
mov   ax,008h            ;define vertical cursor range
mov   cx,600             ;minimum column
mov   dx,600             ;maximum column
int 33h
;#####################################################################
mov   ax,01h             ;show mouse cursor
int 33h                  ;enables the mouse interrupt  
    
Post 16 Mar 2005, 01:47
View user's profile Send private message Reply with quote
liteonish



Joined: 24 Feb 2005
Posts: 26
liteonish 16 Mar 2005, 13:12
Redragon wrote:
Code:
mov   ax,012h            ;set large graphics cursor block
mov   ax,cursor    

There are several possibilities with that part alone. Firstly, you're moving two values to ax one after the other, overwriting the second one with the first. Secondly, you're moving the address of cursor, not its value. (Unless it's something special and not a label. Smile)

So maybe do a
Code:
mov  ah,[cursor]    
but I'm not sure what the int requires, so that probably won't work.

_________________
I just own that much.
Post 16 Mar 2005, 13:12
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.