[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] High order bits



As an archaeological footnote to this, the DEC PDP-6 [later evolved to 
the -10 and then the -20, DEC's line of (wonderful!) 36-bit computers] 
had an opcode "JFFO" -- jump if find-first-one which would find you the 
*highest*order* bit set in the word [falling through if the word was zero 
and there was no bit to find]... can't remember what it did [it either 
turned the bit off or gave you its bit-position or something when it DID 
find a one-bit].

What's interesting, and surprised a lot of novice -6 programmers, was why 
did they go to the bother of building into the hardware a find the 
_highest_ set-bit, and not include a matching opcode for finding the 
_lowest_ [the -6 instruction set was famous for it logicalness and 
completeness... so why leave this out].

The answer, of course, is this very trick: I think it took something like 
one instruction, at most two, to do the lowest-order-bit check if your 
number was already in one of the [16] accumulators.  So there was no need 
for an explicit opcode since it was so easy [and fast] just to do it 
directly [*IF* you knew the trick... :o)]

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com     Pearisburg, VA
    -->  Too many people, too few sheep  <--          

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe