home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,900 of 4,675   
   Terje Mathisen to John   
   Re: duplicates   
   28 Jun 19 09:49:35   
   
   From: terje.mathisen@nospicedham.tmsw.no   
      
   Kerr-Mudd,John wrote:   
   > On Thu, 27 Jun 2019 09:35:22 GMT, "Kerr-Mudd,John"   
   >  wrote:   
   >   
   >> On Thu, 27 Jun 2019 05:35:40 GMT, wolfgang kern   
   >>  wrote:   
   >>   
   >>> ready to continue...   
   > []   
   >>> * cant see where/how a duplicate string goes to screen.   
   >   
   > It should *either* (default) print dupes, or, if /d passed   
   > ('/deleteduplicates'), print non-dupes. The output buffer is written at the   
   > end (DOS int 21 fn x40).   
      
   This is more or less the standard unix uniq tool I believe?   
      
   I.e. this will also either remove all duplicates from a previously   
   sorted array of lines, or output the dup'ed lines.   
      
   I have written one like this in Pascal, the interesting part happens   
   when you make the "is equal" requirement less strict:   
      
   I.e. ignore case, ignore trailing (and leading?) white space?   
      
   Collapse all strings of white space (space/tab) into a single space?   
      
   In order to do it efficiently you need to double your input line buffer,   
   so that after reading a line you immediately collapse it into the   
   generic form, then you compare this with the similarly processed version   
   of the previous line.   
      
   When you need to output something, you should of course always use the   
   original version of the line!   
      
   BTW, if there is to be an exact match, no conversion, the conversion   
   function can be one that simply returns the input pointer instead of   
   allocating/using a separate buffer.   
      
   You create one conversion function for each basic piece of   
   pre-processing to be done, then you have aggregate functions that simply   
   call down to multiple of these to cover combinations.   
      
   At runtime a function pointer directs processing to the currently   
   selected path, so no test/branch anywhere before the final line-vs-line   
   compare results are known.   
      
   Terje   
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca