And I think that this switch subroutine mirrors one way of compiling the BCPL switchon statement (on which C's switch statement was explicitly modelled), though the BCPL compiler I used in the mid-1970s was smarter if the cases formed a compact integer sequence.
C was based upon B, which was based upon BCPL. Clearly, the Bell Labs crew were trying to give themselves some BCPL goodness, even in assembly language.
And BCPL was desiged as very thin language just to be good enough to write the CPL compiler, it was never planned to be used to write full applications.
C was based upon B, which was based upon BCPL. Clearly, the Bell Labs crew were trying to give themselves some BCPL goodness, even in assembly language.