One Assembler trick I have seen in speeding up scanning loops was to use a
CLI instruction to check the first byte of a string and then only doing the
CLC/CLCL if the CLI matches.  This trick even works if doing a binary
search.

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
On Behalf Of Tom Marchant
Sent: Monday, January 16, 2012 6:35 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: How bad is the EX instruction?

On Fri, 13 Jan 2012 18:29:55 -0800, glen herrmannsfeldt wrote:

>> The EX CLC is in fact in loop scanning a linked list for the right
>> entry among 100-200 elements.
>
>You could also do binary search, which will find the right entry with
>about log(n) comparisons.

How do you do a binary search on a linked list?

--
Tom Marchant

Reply via email to