Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to move the mouse cursor with the keyboard

majid1605majid1605 Posts: 1Member
What is the problem my code?

[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 [/code]

Comments

  • gargylegargyle Posts: 1Member
    [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
    [color=Red]mov bh,0[/color]
    [color=Green]mov ah,0[/color]; 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

    [color=red] mov ax,04h
    int 33h
    [/color]
    dec dx
    cmp dx,0
    [color=Orange]jne[/color] lable[color=green]1[/color];think about the orange Part
    [color=green] mov ax,04h
    int 33h
    jmp label1
    [/color]

    lable2:
    mov ax,03h
    int 33h

    [color=Red] mov ax,04h
    int 33h
    [/color] inc dx
    cmp dx,199h
    [color=Orange]jne[/color] lable1;think about the orange Part
    [color=green] mov ax,04h
    int 33h
    jmp label1[/color]

    ;------------ end of program
    mov ax, 4c00h
    int 21h



    codes ends
    end [/code]

    ->
    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
Sign In or Register to comment.