title: Mouse in Assembly 8086
body: <p>As part of a school project I am making a game that shows everything we've learned this semester.
  So I made this game where you're this smiley guy and you run around a maze with obstacles that bring you back to the start of the maze and once you reach the end you go to the next level.</p>
  
  <p>So I wanted to add a title screen with a "button" -- pretty much a title screen drawn in text and then: </p>
  
  <pre><code> mov  ax, 3h
   int  33h
   mov  mouseClick, bx
   mov  mouseX, cx
   mov  mouseY, dx
   call checkMClick
   cmp  mousePos, 1h
   je   goodMPos
   jne  badMPos
  
   goodMPos:
  
   call firstLevel   
   call newMazePos
   call output
  
  ;---------------------------------------;                            
  
   checkMClick: cmp  mouseclick, 1h 
                je   checkMouseX
                jne  mouse  
  
   checkMouseX: cmp  mouseX, 7h
                jge  afterStartX
                jl   mouse
  
   afterStartX: cmp  mouseX, 23h
                jle  goodXPos
                jg   badMPos
  
   goodXPos:    mov  mousePos, 1h
                jmp  checkMouseY
  
   checkMouseY: cmp  mouseY, 7h
                jge  afterStartY
                jl   mouse
  
   afterStartY: cmp  mouseY, 11h
                jge  goodYPos
                jl   badMPos                 
  
   goodYPos:    mov  mousePos, 1h
                ret                 
  
   badMPos:     mov  mousePos, 0h
                jmp  mouse
  </code></pre>
  
  <p>But the coordinates for the mouse position are fucked up.</p>
  
  <p>EDIT: <a href="http://pastebin.com/evsdLM6u" rel="nofollow">Here's the pastebin for the entire thing</a></p>