Wacky_rubia

сравнение 2 строк

Sep 27th, 2015
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sseq segment stack
  2. b db 256 dup(?)
  3. sseq ends
  4.  
  5. dseq segment
  6. strn db 13,10,'less string: $'
  7. s1 db 255 dup(?)
  8. s2 db 255 dup(?)
  9. dseq ends
  10.  
  11. cseq segment
  12. start: assume cs:cseq, ds:dseq, ss: sseq
  13.     mov ax, dseq
  14.     mov ds, ax
  15.  
  16.     mov ah,3fh
  17.     mov bx, 1
  18.     mov cx,255
  19.     lea dx, s1
  20.     int 21h
  21.  
  22.     push ax
  23.  
  24.     mov ah,3fh
  25.     mov bx, 1
  26.     mov cx,255
  27.     lea dx, s2
  28.     int 21h
  29.  
  30.     push ax
  31.  
  32.     mov dx, offset strn
  33.     mov ah, 09h
  34.     int 21h
  35.  
  36.     pop ax
  37.     mov bx,ax
  38.     pop ax
  39.  
  40.     cmp ax, bx
  41.     jb l1less
  42.     mov dx, offset s2
  43.     mov cx, bx
  44.     jmp endt
  45.  
  46. l1less:
  47.     mov dx, offset s1
  48.     mov cx, ax
  49.  
  50. endt:
  51.  
  52.     mov ah, 40h
  53.     int 21h
  54.  
  55.     mov ax,4C00h
  56.     int 21h  
  57.    
  58. cseq ends
  59. end start
Advertisement
Add Comment
Please, Sign In to add comment