Advertisement
NB52053

Draw line mouse

Sep 15th, 2018
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. ;Mouse Draw Line
  4.  
  5.  
  6. org 100h
  7. .model small
  8. .stack 100h
  9. .data  
  10.  
  11. .code
  12. mov dx, @data
  13. mov ds, dx    
  14.    
  15.  
  16. main proc far
  17.  
  18. mov al, 12h
  19. mov ah, 0   ; set graphics video mode.
  20. int 10h  
  21.  
  22. mov ax, 1   ;shows mouse cursor
  23. int 33h
  24.  
  25. Next:
  26. mov ax, 3   ;get cursor positon in cx,dx
  27. int 33h
  28.  
  29. call putpix ;call procedure
  30. jmp Next
  31.  
  32. mov ah,4ch
  33. int 21h
  34. main endp
  35.  
  36. ;procedure to print
  37. putpix proc  
  38. mov al, 7   ;color of pixel  
  39. mov ah, 0ch    
  40. shr cx,1    ; cx will get double so we divide it by two
  41. int 10h     ; set pixel.
  42. ret
  43. putpix endp
  44.  
  45.  
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement