SHARE
TWEET

Numerical or not

rafid_shad Dec 11th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 100h
  3. .data
  4. msg1 db 'Enter a number : $'
  5. msg2 db 10,13,'Numeric$'
  6. msg3 db 10,13,'Not numeric$'
  7. .code
  8. main proc
  9.     mov ax,@data
  10.     mov ds,ax
  11.    
  12.     mov ah,9
  13.     lea dx,msg1
  14.     int 21h
  15.    
  16.     mov ah,1
  17.     int 21h
  18.     mov bl,al
  19.    
  20.     cmp bl,48
  21.     jl a
  22.     cmp bl,57
  23.     jg a
  24.    
  25.    
  26.     mov ah,9
  27.     lea dx,msg2
  28.     int 21h
  29.     jmp exit
  30.    
  31.    
  32.    
  33.     a:
  34.     mov ah,9
  35.     lea dx,msg3
  36.     int 21h
  37.    
  38.    
  39.    
  40.     exit:
  41.     mov ah,4ch
  42.     int 21h
  43.     main endp
  44. 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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top