Advertisement
salmancreation

IF else in Assmbly Language emu8086

Oct 26th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. .DATA
  2. .MODEL SMALL
  3.  
  4. INPUT_M DB 10,13,'ENTER CHARACTER',0DH,0AH,'$'  
  5. MESSAGE1 DB 10,13,'YOU TYPED"A"','$'
  6. MESSAGE2 DB 10,13,'YOU DID NOT TYPE "A"','$'
  7. CHAR DB "  ", '$'
  8.  
  9. .CODE
  10. MAIN PROC    
  11.    
  12.     MOV AX,@DATA
  13.     MOV DS,AX
  14.    
  15.     MOV AH,9
  16.     MOV DX,OFFSET INPUT_M
  17.     INT 21H
  18.    
  19.     MOV AH,01
  20.     INT 21H
  21.     MOV CHAR,AL
  22.     CMP CHAR,"A"
  23.        
  24.     JE EQUAL
  25.     MOV DX,OFFSET MESSAGE2
  26.     MOV AH,9
  27.     INT 21H
  28.     JMP END
  29.    
  30.     EQUAL:
  31.     MOV DX,OFFSET MESSAGE1
  32.     MOV AH,9
  33.     INT 21H
  34.     JMP END
  35.  
  36.   END:    
  37.    
  38.     MOV AX,4CH
  39.     INT 21H  
  40.    
  41.    
  42.     MAIN ENDP
  43. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement