title: how compile this program in lubuntu?
body: <p>I'm trying to compile the following code. the problem is that it doesnt compile.
  i use lubuntu , and sublime text2 , i compile from terminal. I use NASM. but i dont know if the corret syntax. please help me.</p>
  
  <pre><code>MOV AX, CS              ; Load Segment Registers 
      MOV DS, AX 
      MOV ES, AX 
  </code></pre>
  
  <p>Begin: </p>
  
  <pre><code>; Welcome 
  
      MOV AH, 4                               ; CLS 
      INT 21h 
  
  MOV SI, MSG_Welcome 
  MOV AH, 1 
  INT 21h 
  
  XOR AH, AH 
  INT 16h 
  
  CMP AL, '0' 
  JE SHORT End_Program 
  
  CMP AL, '1' 
  JE SHORT StartGame1 
  
  CMP AL, '2' 
  JE SHORT StartGame2 
  
  CMP AL, '3' 
  JE SHORT StartGame3 
  
  JMP SHORT Begin 
  </code></pre>
  
  <p>End_Program: </p>
  
  <pre><code>    MOV AH, 4                               ; CLS 
      INT 21h 
  
  MOV AH, 0 
  INT 21h 
  </code></pre>
  
  <p>StartGame1: </p>
  
  <pre><code>MOV AX, 1 
  MOV [Speed], AX 
  JMP SHORT StartGame 
  </code></pre>
  
  <p>StartGame2: </p>
  
  <pre><code>MOV AX, 2 
  MOV [Speed], AX 
  JMP SHORT StartGame 
  </code></pre>
  
  <p>StartGame3: </p>
  
  <pre><code>MOV AX, 3 
  MOV [Speed], AX 
  JMP SHORT StartGame 
  </code></pre>
  
  <p>StartGame </p>
  
  <pre><code>MOV AH, 1 
  MOV CX, 10280               ; Disable Coursor 
  INT 10h 
  
  
  ; Init Player 1 Position 
  
  MOV BYTE [PosPlayer1], 9 
  MOV BYTE [LastPlayer1], 9 
  
  ; Init Player 2 Position 
  
  MOV BYTE [PosPlayer2], 9 
  MOV BYTE [LastPlayer2], 9 
  
  
  ; Init Ball Position 
  
  MOV BYTE [XPos], 39 
  MOV BYTE [LastX], 39 
  
  MOV BYTE [YPos], 12 
  MOV BYTE [LastY], 12 
  
  ; Init Direction of Ball 
  
  
  MOV BYTE [DirectionX], 1 
  MOV BYTE [DirectionY], 1 
  
  
      MOV AH, 4                               ; CLS 
      INT 21h 
  
  ; Print Game Screen 
  
  
  CALL PrintPlayer1 
  CALL PrintPlayer2 
  CALL PrintBall 
  
  
  DoGame: 
  
      PUSH CX 
  
  .IfX: 
  
  
      MOV AL, [XPos] 
      CMP AL, 4 
      JB NEAR .CheckPlayer1 
      CMP AL, 75 
      JA NEAR .CheckPlayer2 
  
  .IfY: 
  
      MOV AL, [YPos] 
      CMP AL, 2 
      JB NEAR .PosYDirection 
      CMP AL, 21 
      JA NEAR .NegYDirection 
  
  
  .PrintTheBall: 
  
  
      ; Check If any Player pressed a key: 
  
      mov ah, 01h 
      int 16h 
      jz .DoPrint 
  
      xor ah, ah 
      int 16h 
  
  
  
      CMP AL, 'w' 
      JE .SubPlayer1 
      CMP AL, 's' 
      JE .AddPlayer1 
  
      CMP AL, 'o' 
      JE .SubPlayer2 
      CMP AL, 'l' 
      JE .AddPlayer2 
  
      JMP .DoPrint 
  
  
  .AddPlayer1: 
  
  
  
  
      MOV AL, [PosPlayer1] 
  
      CMP AL, 17 
      JE SHORT .DoPrint 
  
      ADD AL, 1 
      MOV [PosPlayer1], AL  
      JMP SHORT .DoPrint 
  
  
  .SubPlayer1: 
  
      MOV AL, [PosPlayer1] 
  
      CMP AL, 0 
      JE SHORT .DoPrint 
  
      SUB AL, 1 
      MOV [PosPlayer1], AL  
      JMP SHORT .DoPrint 
  
  .AddPlayer2: 
  
      MOV AL, [PosPlayer2] 
  
      CMP AL, 17 
      JE SHORT .DoPrint 
  
      ADD AL, 1 
      MOV [PosPlayer2], AL 
      JMP SHORT .DoPrint  
  
  
  .SubPlayer2: 
  
      MOV AL, [PosPlayer2] 
  
      CMP AL, 0 
      JE SHORT .DoPrint 
  
      SUB AL, 1 
      MOV [PosPlayer2], AL 
      JMP SHORT .DoPrint  
  
  
  .DoPrint: 
  
      MOV AX, [XPos] 
      ADD AX, [DirectionX] 
      MOV [XPos], AX  
  
      MOV AX, [YPos] 
      ADD AX, [DirectionY] 
      MOV [YPos], AX  
  
  
      CALL PrintScreen            ; Print Game Screen 
      CALL PrintPlayer1 
      CALL PrintPlayer2 
      CALL PrintBall 
  
  
      CALL WaitTime 
  
  
      JMP ResumeGame 
  
   .PosXDirection: 
  
      MOV BYTE [DirectionX], 1 
      JMP NEAR .IfY 
  
   .NegXDirection: 
  
      MOV BYTE [DirectionX], -1 
      JMP NEAR .IfY 
  
   .PosYDirection: 
  
      MOV BYTE [DirectionY], 1 
      JMP NEAR .PrintTheBall 
  
   .NegYDirection: 
  
      MOV BYTE [DirectionY], -1 
      JMP NEAR .PrintTheBall 
  
  .CheckPlayer1: 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 1 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 2 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 3 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 4 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 5 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer1] 
      ADD BL, 5 
  
      CMP AL, BL 
      JE .PosXDirection 
  
      JMP .Player1Lost 
  
  .CheckPlayer2: 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 1 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 2 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 3 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 4 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 5 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      MOV AL, [YPos] 
      MOV BL, [PosPlayer2] 
      ADD BL, 6 
  
      CMP AL, BL 
      JE .NegXDirection 
  
      JMP .Player2Lost 
  
  .Player2Lost: 
  
      MOV AH, 4                               ; CLS 
          INT 21h 
  
      MOV CX, 3085 
      MOV CX, 1543 
      MOV AH, 1 
      INT 10h 
  
      MOV SI, MSG_Player2_Lost 
      MOV AH, 1 
      INT 21h 
  
      MOV AH, 0 
      INT 21h 
  
  .Player1Lost: 
  
          MOV AH, 4                               ; CLS 
          INT 21h 
  
      MOV CX, 3085 
      MOV CX, 1543 
      MOV AH, 1 
      INT 10h 
  
      MOV SI, MSG_Player1_Lost 
      MOV AH, 1 
      INT 21h 
  
      MOV AH, 0 
      INT 21h 
  
  
  
  ResumeGame: 
  
  
      POP CX 
  
      JMP DoGame 
  
  
  
  
  
  MOV AH, 4                               ; CLS 
      INT 21h 
  
  MOV AH, 0 
  INT 21h 
  </code></pre>
  
  <p>WaitTime: </p>
  
  <pre><code>XOR AH, AH 
  INT 1Ah 
  
  MOV BX, DX 
  
  
  .GetNewTime: 
  
      PUSH BX 
      XOR AH, AH 
      INT 1Ah 
      POP BX 
  
      SUB DX, BX 
      MOV AX, [Speed] 
      CMP DX, AX 
      JB SHORT .GetNewTime 
  
  JMP ResumeGame 
  </code></pre>
  
  <p>PrintScreen: </p>
  
  <pre><code>MOV DL, [XPos] 
  MOV DH, [YPos] 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  SUB DL, 1 
  SUB DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  SUB DL, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  SUB DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  ADD DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  ADD DL, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  ADD DL, 1 
  ADD DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  ADD DL, 1 
  SUB DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  SUB DL, 1 
  ADD DH, 1 
  CALL LocateXY 
  CALL PrintDummy 
  
  
  
  
  
  RETN 
  </code></pre>
  
  <p>PrintPlayer1: </p>
  
  <pre><code>; Clear Last Position of Player 
  
  MOV DH, [LastPlayer1] 
  MOV DL, 3 
  
  CALL LocateXY 
  
  MOV CX, 6 
  
  .ClearOldPos: 
  
      CALL PrintSpace 
      CALL PrintSpace 
  
      INC DH 
      MOV DL, 3 
  
      CALL LocateXY 
      LOOPNZ .ClearOldPos 
  
  ; Print Player 
  
  
  MOV DH, [PosPlayer1] 
  MOV DL, 3 
  
  CALL LocateXY 
  
  MOV CX, 6 
  .PrintPos: 
  
      CALL PrintBlock 
      CALL PrintBlock 
  
      INC DH 
      MOV DL, 3 
  
      CALL LocateXY 
      LOOPNZ .PrintPos 
  
  MOV AL, [PosPlayer1] 
  MOV [LastPlayer1], AL 
  
  RETN 
  </code></pre>
  
  <p>PrintPlayer2: </p>
  
  <pre><code>; Clear Last Position of Player 
  
  MOV DH, [LastPlayer2] 
  MOV DL, 76 
  
  CALL LocateXY 
  
  MOV CX, 6 
  
  .ClearOldPos: 
  
      CALL PrintSpace 
      CALL PrintSpace 
  
      INC DH 
      MOV DL, 76 
  
      CALL LocateXY 
      LOOPNZ .ClearOldPos 
  
  ; Print Player 
  
  
  MOV DH, [PosPlayer2] 
  MOV DL, 76 
  
  CALL LocateXY 
  
  MOV CX, 6 
  
  .PrintPos: 
  
      CALL PrintBlock 
      CALL PrintBlock 
  
      INC DH 
      MOV DL, 76 
  
      CALL LocateXY 
      LOOPNZ .PrintPos 
  
  
  MOV AL, [PosPlayer2] 
  MOV [LastPlayer2], AL 
  
  RETN 
  </code></pre>
  
  <p>PrintBall: </p>
  
  <pre><code>; Clear Last Position of Ball 
  
  MOV AL, [XPos] 
  MOV [LastX], AL 
  
  MOV AL, [YPos] 
  MOV [LastY], AL 
  
  ; Print New Ball 
  
  MOV DL, [XPos] 
  MOV DH, [YPos] 
  
  CALL LocateXY 
  CALL PrintB      
  
  RETN 
  </code></pre>
  
  <p>PrintSpace: </p>
  
  <pre><code>MOV AH, 11 
  MOV AL, ' ' 
  INT 21h 
  RETN 
  </code></pre>
  
  <p>PrintDummy: </p>
  
  <pre><code>MOV AH, 11 
  MOV AL, ' ' 
  INT 21h 
  RETN 
  </code></pre>
  
  <p>PrintBlock: </p>
  
  <pre><code>MOV AH, 11 
  MOV AL, '²' 
  INT 21h 
  RETN 
  </code></pre>
  
  <p>PrintB: </p>
  
  <pre><code>MOV AH, 11 
  MOV AL, 'Û' 
  INT 21h 
  RETN 
  </code></pre>
  
  <p>LocateXY: </p>
  
  <pre><code>; DL = X 
  ; DH = Y 
  
  PUSH AX 
  PUSH BX 
  
  MOV AH, 02h 
  MOV BH, 0 
  INT 10h 
  
  POP BX 
  POP AX 
  
  
  RETN 
  
  
      PosPlayer1   DB 0 
  LastPlayer1  DB 0 
      PosPlayer2   DB 0 
  LastPlayer2  DB 0 
  
  
      XPos         DB 0 
  LastX        DB 0 
      YPos         DB 0 
  LastY        DB 0 
  
  DirectionX    DB 0  ; -1 and +1 
  DirectionY    DB 0  ; -1 and +1 
  
  Speed   DB 0 
  
  
  MSG_Player1_Lost    DB 'Player 1 lost the game!',13,10,0 
  MSG_Player2_Lost    DB 'Player 2 lost the game!',13,10,0 
  
  MSG_Welcome     
              DB 'This game is made for two player. The aim of the game is to bounce the ball',13,10, 
              DB 'so that it can not reach the screen boarder.',13,10, 
              DB 'Player 1 controlls his block with the Key &gt;W&lt; to move it upwards and &gt;S&lt; to',13,10, 
              DB 'move it downwards. Player 2 controlls his key with &gt;O&lt; for upwards and &gt;L&lt;',13,10, 
              DB 'downwards.',13,10, 
              DB 'The game will be terminated when a Player lost.',13,10,13,10, 
              DB 'Choose your game speed. After pressing the option the game will be started.',13,10, 
              DB ' 0 - terminate the game',13,10, 
              DB ' 1 - fast',13,10, 
              DB ' 2 - middle',13,10, 
              DB ' 3 - slow',13,10, 
              DB 'Your Option: ',0 
  
  
  
  Dummy   TIMES 10 DB 0 
  </code></pre>