StoneHaos

mishar_sist_8

May 4th, 2021
585
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include io.asm
  2.  
  3. sstack segment stack
  4.     db 128 dup(?)
  5. sstack ends
  6.  
  7. sdata segment
  8.    
  9.     string db 256 dup(?)
  10.  
  11.     input: db "Input string (dollar = end)> ", "$"
  12.     inputch: db "Input char> ", "$"
  13.     s_noresult: db "NO", "$"
  14.     s_result: db "YES", "$"
  15.  
  16.  
  17. sdata ends 
  18.  
  19. scode segment
  20. .386
  21.     assume cs:scode, ds:sdata, ss:sstack
  22.  
  23.  
  24. start:
  25.    
  26.     mov ax,sdata
  27.     mov ds,ax
  28.     mov dx,offset input
  29.     outstr
  30.  
  31.     mov di,0
  32.     cycle1:
  33.         inch al
  34.         mov [string+di],al
  35.         inc di
  36.         cmp al,36
  37.         jne cycle1
  38.    
  39.     mov dx,offset inputch
  40.     outstr
  41.  
  42.     inch al
  43.  
  44.     mov di,0
  45.     cycle2:
  46.         mov ah,[string+di]
  47.         cmp ah,36
  48.         je noresult
  49.         inc di
  50.         cmp ah,al
  51.         jne cycle2
  52.  
  53. result:
  54.     mov dx,offset s_result
  55.     outstr
  56.     jmp endstart
  57.  
  58. noresult:
  59.     mov dx,offset s_noresult
  60.     outstr
  61.    
  62.  
  63. endstart:
  64.     finish
  65. scode ends
  66. end start
RAW Paste Data