x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4556
Number of posts: 16011

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to move the mouse cursor with the keyboard Posted by majid1605 on 10 Jan 2013 at 2:11 PM
What is the problem my code?

stacksg segment para stack 'stack'

stacksg ends

datasg segment para 'data'

  msg db "A. $", 0
datasg  ends

codes segment para 'code'
assume ss:stacksg, ds:datasg, cs:codes
   mov ax, datasg
   mov ds, ax
    ;------------ ur programm
    
	
	mov al,4
	mov bh,0
	int 10h
	
	mov bh,0
	mov bl,1001b
	mov ah,0Bh
	int 10h
	
	mov ax,0
	int 33h
	
	mov ax,01h
	int 33h
	
	;mov dx,101h
	;mov cx,161h
lable1:
	
	mov ah,10h
	int 16h
	cmp al,48h ;up key (arrow) 24dec
	je lable
	cmp al,50h ;Down key (arrow) 24dec
	je lable2
	
	
lable:
	mov ax,03h
	int 33h
	
	mov ax,04h
	int 33h
	dec dx
	cmp dx,0
	jne lable1
	
lable2:
	mov ax,03h
	int 33h
	
	mov ax,04h
	int 33h
	inc dx
	cmp dx,199h
	jne lable1
	
    ;------------ end of program
    mov ax, 4c00h
    int 21h

	

codes ends
     end 

Report
Re: How to move the mouse cursor with the keyboard Posted by gargyle on 16 Jan 2013 at 11:21 AM
stacksg segment para stack 'stack'

stacksg ends

datasg segment para 'data'

  msg db "A. $", 0
datasg  ends

codes segment para 'code'
assume ss:stacksg, ds:datasg, cs:codes
   mov ax, datasg
   mov ds, ax
    ;------------ ur programm
    
	
	mov al,4
	mov bh,0
	mov ah,0; i think you want to set video mode
	int 10h

-> http://en.wikipedia.org/wiki/INT_10H
-> http://stanislavs.org/helppc/int_33.html
	
	mov bh,0
	mov bl,1001b
	mov ah,0Bh
	int 10h
	
	mov ax,0
	int 33h
	
	mov ax,01h
	int 33h
	
	;mov dx,101h
	;mov cx,161h
lable1:
	
	mov ah,10h
	int 16h
	cmp al,48h ;up key (arrow) 24dec
	je lable
	cmp al,50h ;Down key (arrow) 24dec
	je lable2
	
	
lable:
	mov ax,03h
	int 33h
	
	mov ax,04h
	int 33h

	dec dx
	cmp dx,0
	jne lable1;think about the orange Part
	mov ax,04h
	int 33h
	jmp label1

	
lable2:
	mov ax,03h
	int 33h
	
	mov ax,04h
	int 33h
	inc dx
	cmp dx,199h
	jne lable1;think about the orange Part
	mov ax,04h
	int 33h
	jmp label1
	
    ;------------ end of program
    mov ax, 4c00h
    int 21h

	

codes ends
     end 


->
INT 33,4 - Set Mouse Cursor Position



AX = 4
CX = horizontal position
DX = vertical position


returns nothing


- default cursor position is at the screen center
- the position must be within the range of the current video mode
- the position may be rounded to fit screen mode resolution

Hope i found all



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.