Advertisement
Guest User

Untitled

a guest
Nov 8th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cseg segment
  2. assume cs:cseg, ds:cseg, ss:cseg, es:cseg
  3. org 100h
  4. Start:                                        
  5.   mov si,offset Array
  6. INITIAL:
  7.   lodsb
  8.   mov bl, al
  9.   mov cx,1
  10.   jmp PROVERKA
  11. PROVERKA:
  12.   lodsb
  13.   cmp al,24h
  14.   je STRCOMP
  15.  
  16.   cmp al,bl
  17.   jg NEWMAX
  18.   je REPEATMAX
  19.   jmp PROVERKA
  20.  
  21. NEWMAX:
  22.   mov bl, al
  23.   mov cx, 1
  24.   jmp PROVERKA
  25. REPEATMAX:
  26.   inc cx
  27.   jmp PROVERKA
  28. STRCOMP:
  29.   mov ah,9
  30.   mov dx,offset String1
  31.   int 21h
  32.   cmp cx,1
  33.   jg YES
  34.   jmp NO
  35. YES:                                                
  36.   mov ah,9
  37.   mov dx,offset String2
  38.   int 21h
  39.   jmp EXIT
  40. NO:
  41.   mov ah,9
  42.   mov dx,offset String3
  43.   int 21h
  44. EXIT:
  45.   mov ah,10h
  46.   int 16h
  47.   int 20h                                            
  48.  
  49. Array db 10,8,3,4,6,8,9,24h
  50. String1 db '10,8,3,4,6,8,9.$'
  51. String2 db 10, 13, 'max repeats: YES$'
  52. String3 db 10, 13, 'max repeats: NO$'
  53. cseg ends
  54. end Start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement