You can also generate code on the first reference in dynamic memory and use 
that generated code to do the compares.  Just build a little subroutine at run 
time and branch to that subroutine to do the actual compares, etc.  Several 
software products do this.

Lloyd


>________________________________
> From: Robert A. Rosenberg <a...@rarpsl.com>
>To: ASSEMBLER-LIST@LISTSERV.UGA.EDU 
>Sent: Thursday, October 24, 2013 5:12 PM
>Subject: Re: Linear search vs binary
>  
>
>At 12:45 -0400 on 10/24/2013, Tony Thigpen wrote about Re: Linear
>search vs binary:
>
>>All entries will be fixed length. Can't really have variable length and
>>use a binary search.
>
>That depends. If the table you are sorting is a table of pointers to
>the actual data (and is ordered by the compare field), the entries
>can be variable length so long as the compare field is fixed length
>and is preceded by an entry length field. You use the pointer to find
>the compare field of an entry and once you find the correct entry,
>you back up to the location of the entry length and can then use the
>entry.
>
>
>

Reply via email to