guys?
im creating my own program..first im using tasm..
my problem is i have the code for cursor..

;set cursor location(dh,dl)
mov     dl, 16  ; column. 
mov     dh, 16   ; row. 
mov     ah, 02h
int     10h
;symbol of cursor
mov     al, 'x'
mov     ah, 0eh
int     10h

my problem is how to use move it with the mouse..
my code was just a location..
can some1 help me with my code..
thanks..
Jingo Rodriguez

Recommended Answers

All 16 Replies

INT 10h
AH=2 Set Cursor Position
DH=Row
DL=Column
BH=page 0...7

thanks wild..btw i also found about the mouse interrupt which is int 33..
does int 33 has something to do with movement of the cursor?or not at all?
Jingo Rodriguez

No. 10h is Video Interrupt for displaying data.

Mouse interrupt is for reading mouse input. If I remember correctly, there is no mouse position, its more like a mouse movement, and you keep an x,y tally in your program. Just review the mouse commands available.

ok i have no idea with 10h interrupt i was exploring it...
btw how do you tally x and y? i know dh and dl are for rows and columns..what i want is the cursor will move as i move my mouse..
so no int 33h for that one right?

You're going to have to do the heavy lifting.

Do a google search for "int 33h functions"
Mouse BIOS

ok here i have a list of services for int 33h...
im using an optical mouse..don't know which is which..
well i see this service which is

mov ax,0001h
int 33h

but i wonder how come i cant see my cursor in dos?btw can i combine multiple interrupts in assembly like combining 33 to 21 and so on?
here is the link for int 33h http://www.ctyme.com/intr/int-33.htm

Jingo Rodriguez

You really need to read that archaic documentation. All those extra functions are from certain driver/packages, etc. If you're in DOS text mode and you paint a cursor it'll most likely be a block. If you're in DOS graphics mode due to setting 10h Video Bios to a graphics mode then the Mouse driver would theoretically paint a mouse graphic.

The following link is more like what is available...
http://www.emu8086.com/assembly_language_tutorial_assembler_reference/8086_bios_and_dos_interrupts.html

if i want to set my video mode which is 00h in 10h interrupt, i should consider my video card model and my processor right?cause ive encounter a 16-bit problem while executing..

mov al, 13h ;G  40x25  8x8   320x200  256/256K  .   A000               
                           ;VGA,MCGA,ATI VIP
	mov ah, 0
	int 10h

i think 13h isnt compatible for my laptop i have ati mobility radeon:hd 3470..
btw i if keep on exploring some codes out of nowhere is it possible that i might destroy my video card?

You are trying to run an archaic BIOS that was designed back in 1980. Video hardware is designed to run at much higher resolutions now, and BIOS were originally designed for text modes and graphics modes but I'm not sure if they computer boots up in a 80x25 text mode or a graphics mode. Trying to get it to do a MCGA mode definitely isn't a thing I would try. However one would think if the built in video controller couldn't handle it, they would have removed those particular video modes from the BIOS.

What was that 16-bit problem when executing that MCGA graphics mode initialization? We can't try to help with problems if you don't explain them.

If you're going to play with mouse movement and keyboard and such why not use an emulator program, or use Windows or LINUX?

These particular kind of questions related to BIOS I can't answer anymore because the answers are out of date, and sorry to say, I'm not about to put my development system at risk to replicate an issue. Most old programs don't work anymore, some still do.

oh..well im just trying to explore some stuff though..
uhmmz the error? well know the error is like the system does not support fullscreen mode..thanks for the help wild..im just really new with assembly thats why..making me curious to learn it.ok ill try to follow your advise to use some emulator..

ok now im starting with my code user interface should be the last atleast since i need to work with my codes first at file managing..
i found out this code for creating a file..

;mov cx, 0       ;  normal - no attributes. 
 ;mov cx, 1       ;  read-only. 
 ;mov cx, 2       ;  hidden. 
 ;mov cx, 4       ;  system 
 ;mov cx, 7       ;  hidden, system and read-only! 
 ;mov cx, 16      ;  archive 
	
.model small
.stack 100h
.data
        FileName db "myfile.txt", 0 
.code
start:
creatfile:        
        mov ah, 3ch
	mov cx, 0
	mov dx, offset FileName
	mov ah, 3ch
	int 21h
	jc err
	mov handle, ax
	jmp k
	
	handle dw ? ;anyone knows what does this code mean? 
	err:              ;
	; ....             ;
	k:                 ;
mov ah,4ch ; terminate program
int 21h
end start

ok does that code with handle dw ? mean that it will delete the file with the same name?i mean like paste and replace the file?
Thanks..

If the file already exists its contents are removed thus reseting the file size to zero bytes.

Here's how you can check if MCGA mode is supported,
and plot a pixel to the screen.
If the prog screws up MCGA mode might be temporarily
disabled (in the console) until the console window is closed and
opened again.
Try it out.

start:
mov ax,0x1a00 ; Check if VGA/MCGA is supported
int 0x10
cmp ax,0x1a
jnz not_supported
mov ax, 0x13    ; Go MCGA mode
int 0x10
mov ax, 0xa000 ; Load ES with seg addr of video ram
mov es, ax
mov byte [es:0],9 ; plot left most pixel bright-blue
waitkey:
mov ah, 0x6
mov dl, 0xff
int 0x21
jz waitkey
mov ax, 0x3 ; back to text mode
int 0x10
int 0x20

msg db 'MCGA mode not supported',0dh,0ah,24h
not_supported:
mov dx, msg
mov ah, 0x9
int 0x21
int 0x20

ok thanks guys..now ill try to do and try those codes when i come home after class..

Here's how you can check if MCGA mode is supported,
and plot a pixel to the screen.
If the prog screws up MCGA mode might be temporarily
disabled (in the console) until the console window is closed and
opened again.
Try it out.

start:
mov ax,0x1a00 ; Check if VGA/MCGA is supported
int 0x10
cmp ax,0x1a
jnz not_supported
mov ax, 0x13    ; Go MCGA mode
int 0x10
mov ax, 0xa000 ; Load ES with seg addr of video ram
mov es, ax
mov byte [es:0],9 ; plot left most pixel bright-blue
waitkey:
mov ah, 0x6
mov dl, 0xff
int 0x21
jz waitkey
mov ax, 0x3 ; back to text mode
int 0x10
int 0x20

msg db 'MCGA mode not supported',0dh,0ah,24h
not_supported:
mov dx, msg
mov ah, 0x9
int 0x21
int 0x20

ok ive tried those codes above..and has lots of error i did converter some but i think its not right..im using tasm as an compiler

mov ax,0x1a00 ; Check if VGA/MCGA is supported
int 10
cmp ax,0x1a
jnz not_supported
mov ax, 13    ; Go MCGA mode
int 10h
mov ax, 0xa000 ; Load ES with seg addr of video ram
mov es, ax
mov byte [es:0],9 ; plot left most pixel bright-blue
waitkey:
mov ah, 06
mov dl, 0xff
int 21h
jz waitkey
mov ax, 3 ; back to text mode
int 10h
int 20h

msg db 'MCGA mode not supported',0dh,0ah,24h
not_supported:
mov dx, msg
mov ah, 9
int 21h
int 20h

btw wat type is 0x000 something?is decimal,binary,or system type?
i use only hexadecimal and decimal. thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.