SHARE
TWEET

asemmbly 5

rafid_shad Oct 23rd, 2019 (edited) 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .data
  3.  
  4. msg1 db  0dh,0ah,"Enter a Value :  $"
  5. msg2 db  0dh,0ah,"The value is same $"  
  6. msg3 db  0dh,0ah,"The value isn't  same $"
  7.  
  8. x db ?
  9.  
  10. main proc
  11.     mov ax,@data
  12.     mov ds,ax
  13.    
  14.     mov ah,9
  15.     lea dx,msg1
  16.     int 21h  ;print string
  17.    
  18.     mov ah,1
  19.     int 21h   ;take input
  20.     mov x,al  ;move input to variable
  21.    
  22.     CMP x,53  ;compare with 5
  23.     JE level  ; if same execute level
  24.    
  25.    
  26.     mov ah,9   ;if not the execute this partr
  27.     lea dx,msg3
  28.     int 21h
  29.    
  30.     JMP exit    ;goto exit
  31.    
  32.    
  33.     level:       ;value are same
  34.     mov ah,9  
  35.     lea dx,msg2
  36.     int 21h
  37.    
  38.  
  39.     exit:
  40.     main endp
  41. end main
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top