title: how to find and display files with similar file names using assembly language?
body: <p>The machine problem is to find and display files with similar file names on different directories, using assembly language.. a console program compiled using tasm &amp; tlink or emulator 8086 ...</p>
  
  <p>Here's the code that I have tried, it only displays the list of files. My problem is i don't know how to make it display only those files with similar file names .. any ideas with regards to my problem will really be appreciated. Thanks ..</p>
  
  <pre><code>.model small, c
  
  .stack
  
  .data
      file_spec db "*.*", 0
      DTA db 128h dup(0)
      buffer db 30 dup(0)
  
  .code
  main proc
      mov ax, @Data
      mov ds, ax
      mov dx,offset DTA
      mov ah,1Ah
      int 21h ; set DTA location
  
      mov dx,offset file_spec
      xor cx, cx
      mov ah,4Eh
      int 21h
      jc  quit
  
  print_name:
      lea si, DTA + 30
  
  next_char:
      lodsb
      int 29h
      test al, al
      jnz next_char
  
      mov al, 13
      int 29h
      mov al, 10
      int 29h
  
      mov dx, offset file_spec
      xor cx, cx
      mov ah, 4fh
      int 21h
      jnc print_name
  
  quit:   
      mov ax, 4c00h
      int 21h
  main endp
      end main
  </code></pre>
  
  <p>Here's another source code that i have tried, this time i have used int 21h , 4eh , 4fh (in MS Dos) .. please can someone help me enhance this code to be able to display only those files with similar file names? any kind of help will be so much appreciated. Thanks in advance..</p>
  
  <pre><code>.model small, c
  
  .stack
  
  .data
      file_spec db "*.*", 0
      DTA db 128h dup(0)
  
  .code
      main proc
      mov ax, @Data
      mov ds, ax
      mov dx,offset DTA
      mov ah,1Ah
      int 21h
  
      mov dx,offset file_spec
      xor cx, cx
      mov ah,4Eh
      int 21h
      jc  quit
  
  print_name:
      lea si, DTA + 1eh
  next_char:
      lodsb
      int 29h
      test al, al
      jnz next_char
  
      mov al, 13
      int 29h
      mov al, 10
      int 29h
  
      mov dx, offset file_spec
      xor cx, cx
      mov ah, 4fh
      int 21h
      jnc print_name
   quit:   
      mov ax, 4c00h
      int 21h
   main endp
      end main
  </code></pre>