Howdy, Stranger!

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

Categories

How to move the mouse cursor with the keyboard

majid1605majid1605 Member Posts: 1
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 Member Posts: 1
    [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
  • _DedSec_DedSec AlabamaMember Posts: 1

    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

    Thanks man, very helpful :-)
    I ought to learn at least the basic interrupts.

Sign In or Register to comment.