如何在汇编语言中显示鼠标单击时像素的移动

时间:2014-02-02 17:59:12

标签: assembly tasm

我想显示一个像素的移动,当我点击屏幕时,一个像素显示在点击的位置,但是点击屏幕上的任何其他点像素应该移动到该位置,像素的移动应该像动画一样可见.issue是运动不可见,老像素没有隐藏.plz帮我这里是我的代码:

.model small
.stack 100h
.code

main proc

    mov ah,0
    mov al,6    ;video mode
    int 10h

    mov ax,0
    int 33h         ;initializing mouse pointer

    mov ax,01
    int 33h          ;show mouse pointer

mov ax,07
mov cx,100            ;set horizontal limit

mov dx,500
int 33h               


mov ax,08      ;set verticle limit
mov cx,50

mov dx,160
int 33h


    MLP:    


    MOV AX,5        
    INT 33h    


    CMP AX,1        ;this compares button status with 1(left button)
    JNE MLp     ;mouse loop executes untill left button press 


mov ax,03    ;get current location of mouse pointer

int 33h         
    mov ah,0ch       ;it glow pixel on current mouse position
    mov al,01         
        dec dx

    int 10h

jmp MLp                  ;for clicking more than 1

    mov ah,01        ;show screen untillany key pressed
    int 21h

    mov ah,0         ;back to text mode
    mov al,3
    int 10h

    mov ah,4ch       ;terminate dos shell
    int 21h

main endp
end main

0 个答案:

没有答案